Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about CS50's Introduction to Programming with Python.
0
votes
cs50p assignment 1... extensions
str.endswith("") always returns true. You are going to need to do some refactoring now that you know the reason for the problem.
1
vote
CS50P PSET 2 Vanity Plates
What does zero_first_digit return if there are no digits?
2
votes
Accepted
problem set 4, CS50P , Guessing Game ,
Review the spec.
Prompts the user for a level,n. If the user does not input a positive integer, the program should prompt again.
Randomly generates an integer between 1 and n, inclusive, using the ra …
1
vote
Taquería doesn't read my output correctly
The specification expects the output to be one number (the total) after each item is entered. This program will print a total for each item in the order every time an item is added to the order. Speci …
0
votes
Accepted
Pset3 Fuel :can't split successfully when fraction containing 100
Read the doc on pthon string find method:
Return the lowest index in the string where substring sub is found within the slice s[start:end]. Optional arguments start and end are interpreted as in slic …
5
votes
Accepted
CS50P PSET3 outdated.py
The input " 9/8/1636 " contains the (trailing) space and the program does not account for that, therefore it is in the output as entered.
"other than a missing comma." is a good guess because the spec …
2
votes
Accepted
CS50P Little Professor error
You need to structure the program as per the spec
import random
def main():
...
def get_level():
...
def generate_integer(level):
...
if __name__ == "__main__":
main()
1
vote
Accepted
: ( Little Professor displays number of problems correct Cause: Did not find "9" in "Level: ...
When rounds is 0, the while loop exits This line if rounds == 0: never evaluates to True.
0
votes
TypeError in "Taqueria" Pset3
This item_cost = menu.get(item) will set item_cost to the entered item, a str type. Program needs to get the value (cost) for the entered key (item).
1
vote
Accepted
CS50P PSET6 Scourgify check50 error
check50 tells it all "Did you mistakenly open your file in append mode?". Program does open the output file in append mode. This is a mistake when the output file already exists and contains data. One …
1
vote
PS6 Lines Of Code :( lines.py yields 2058 given 2058 lines of code in an open-source library...
Any line in the input file that is all spaces will give an IndexError here in testLines function
lines = [s for s in lines if s.lstrip()[0] != "#"]
and will take the except branch and report "Too few …
0
votes
problems with little professor not rejecting inputs that check50 says it should
The program is not structured as specified
Structure your program as follows, wherein get_level prompts (and, if need be, re-prompts) the user for a level and returns 1, 2, or 3, and generate_integer …
0
votes
CS50P problem set 1 Meal Time unknown error
The spec says:
convert is a function (that can be called by main) that converts time, a str in 24-hour format...
In this program, convert takes a list.
1
vote
I tried a lot of ways but couldn't figure out why this exit code is always 1.(cs50p-Pset5)
The spec says "restructure your code as below":
def main():
...
def value(greeting):
...
if __name__ == "__main__":
main()
The posted code is not structured as specified.
1
vote
Felipe's Taqueria: output check problem
From the python doc:
get(key[, default])
Return the value for key if key is in the dictionary, else default. If default is not given, it defaults to None, so that this method never raises a KeyError. …