Skip to main content

Questions tagged [cs50p]

Questions about CS50's Introduction to Programming with Python.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

How do you simultaneously take care of two types of user_input in python?

Greeting everyone, I am doing CS50P course and stuck on week 3 last question titled "outdated". problem statement: n the United States, dates are typically formatted in month-day-year order (...
Swayam Jha's user avatar
1 vote
1 answer
11 views

PSET 7: test_numb3rs.py validation issue

I am not sure how to ensure the below criteria is met keeping validate function intact. Please help me understand what I should be doing here "Modify the validate function in the correct version ...
Athi's user avatar
  • 23
-1 votes
0 answers
9 views

Problem Set 6 CS50P-Shirt

Trouble with Imageops.fit() Please Ignore formatting mistakes i have never used Stack import sys from PIL import Image, ImageOps import os image_path = sys.argv[1] shirt_path = "Shirt.png" ...
Forklift Certified's user avatar
0 votes
1 answer
8 views

PSET 5 Test plates : getting exit code 0 instead of 1

test_plates: from plates import is_valid def test_correct(): assert (is_valid("ASD123")) == True assert (is_valid("ASD")) == True assert (is_valid("AS2")) == ...
Athi's user avatar
  • 23
-1 votes
2 answers
30 views

Little Professor CHECK50 errors can't pass tests

Here's the check50 terminal message: :) Little Professor rejects level of 0 :) Little Professor rejects level of 4 :) Little Professor rejects level of "one" :) Little Professor accepts ...
Roberto Lacowicz's user avatar
0 votes
2 answers
32 views

CS50 python little professor problem

import random def main(): level = get_level("Level: ") correct_count = 0 for _ in range(10): x = generate_integer(level) y = generate_integer(level) ...
subhasis dehury's user avatar
0 votes
2 answers
98 views

Pset 3: Grocery list, the program ends after one item is inputted

I am trying to do the "Grocery" problem, and I have many issues. First, the program exits after the first input. Second, I have an issue with associating the counted item with the list. My ...
Elvino Michel's user avatar
0 votes
2 answers
28 views

PS5: Vanity Plates : Expected exit code 0, not 1 while testing

After using check50 on my test_plates.py file, I get the following error and it doesn't further check anything ( "can't check until a frown turns upside down"): Cause expected exit code 0, ...
theparanormal22's user avatar
0 votes
2 answers
26 views

Felipe's Taqueria: output check problem

This is my code for the Felipe Taqueria's problem and the output is as expected but I am required to output "Total" before the prompt "Enter your order" but I am unable. Someone ...
Grace 's user avatar
  • 25
0 votes
2 answers
53 views

Inifinite loop for outdated problem

I am working on the "outdated" problem. I need to reformat the output given by the user in order to adehere to the ISO format. My code is as follows: months = ["January", "...
Elvino Michel's user avatar
1 vote
1 answer
31 views

Felipe’s Taqueria: "invalid decimal literal" with f string, but ok without f string. Why?

I am still on "Felipe’s Taqueria" problem, and I do not understand why I get the : "invalid decimal literal" error. My code to print the result is as follwos: print(f"$ { &...
Elvino Michel's user avatar
0 votes
2 answers
66 views

CS50x: Issue on problem Felipe´s Taqueria, program keeps asking me for input, without printing price, why?

I am trying to execute the problem "Felipe´s Taqueria", but I am failing to see any price printed as output. Instead the program keeps asking for input. When I input "Taco", the ...
Elvino Michel's user avatar
0 votes
1 answer
50 views

Check 50 insists test with pytest is exiting with code 2, in pset 5 for intro to python, how do I fix this?

it's my first post and I have no idea what I'm doing, so go easy. I'm having issues with the first problem in pset 5 of intro to python, testing my twttr. Basically I made some very basic unit tests ...
TheOtherJohn's user avatar
0 votes
1 answer
240 views

CS50P Little Professor error expected "9", not "level: 6 + 6 =..."

When doing check50 I get the error ":( Little Professor displays number of problems correct ". I've found this post where the code works but after comparing it with my own code I still can't ...
Yazkis's user avatar
  • 11
-1 votes
1 answer
67 views

pset4 adieu problem set 4

I am having trouble with the check50. On manual check, the code functions exactly as it is suppose to but on check50 I get the following error codes. :) adieu.py exists Log checking that adieu.py ...
Marilyn's user avatar
0 votes
1 answer
26 views

Vanity plates Regex problem

I have this code using regex as follows, but when all my characters are letters it gives out an output of "invalid" whereas it should not: import re def main(): plate = input("...
Grace 's user avatar
  • 25
0 votes
1 answer
96 views

problem set 4, CS50P , Guessing Game ,

running python3 testing.py... sending input 22... sending input 18... checking for output "Too large!"... my code couldn't pass the guessing game test, the test is sending 22 as a number ...
Subhan SA's user avatar
1 vote
1 answer
269 views

Vanity plates Problem

The following code is my code for the vanity plates problem in cs50 introduction to python course. My issue is on the "Punctuation Function". When I enter an input with a punctuation, ...
Grace 's user avatar
  • 25
1 vote
1 answer
152 views

CS50 Vanity plates

I modified my code with respect to the suggestions given in the comments using regex as follows, but when all my characters are letters it gives out an output of "invalid" whereas it should ...
Grace 's user avatar
  • 25
0 votes
0 answers
57 views

Why is my cs50p codespace not loading- it takes to long!

I'm currently trying to load my cs50p codespace on my mobile phone but it loads really slow and doesn't load all features
Usifo Emmanuel's user avatar
0 votes
1 answer
54 views

"test_fuel catches fuel.py not printing % in gauge expected exit code 1, not 0"

I have passed all of the other check50 requirements except for this one. Here is my code def main(): while True: try: number = input("Fraction: ") if &...
Bryan Tamrin's user avatar
0 votes
0 answers
13 views

What could be a pytest file for this program?

I have written this program as my final project. How would I write a pytest file to assure the program is properly tested. It really confused me since the functions I implemented in the program do NOT ...
Alaa Hamoush's user avatar
-1 votes
1 answer
69 views

the check50 of the test_fuel is not working in cs50p

this code is working just fine through check50 of the main problem set Fuel Gauge and the pytest for this testing code is successful def main(): while True: try: x = input(&...
Fouad Nabil's user avatar
1 vote
1 answer
47 views

Error message Little Professor displays number of problems correct Cause: Did not find "9" in "Level: 6 + 6 =..."

I am currently unable to pinpoint the root cause of the error message at this time. :( Little Professor displays number of problems correct expected "9", not "Level: 6 + 6 =..." ...
Ivan Torres's user avatar
0 votes
1 answer
49 views

I tried a lot of ways but couldn't figure out why this exit code is always 1.(cs50p-Pset5)

It's the test result of my cs50p course of week 5(Back to the Bank). But when I check my code manually, it seems completely fine to me and I think that there is no problem. But the problem is in the ...
Syed Navid Nowroz Twoki's user avatar
0 votes
0 answers
39 views

Cs50 Final Project

I currently finished all Weeks and have the final project left. I am planning to start with it very soon, I have two questions :- Will i be able to redo the project if I get a grade that is less than ...
Alaa Hamoush's user avatar
0 votes
1 answer
66 views

CS50P problem set 1 Meal Time unknown error

I made a solution for problemset 1, Meal Time from CS50P and I can't get a check from check50. The code works for me if I input the code myself but when I run check50 I get the error: I found the ...
Yazkis's user avatar
  • 11
1 vote
1 answer
96 views

: ( Little Professor displays number of problems correct Cause: Did not find "9" in "Level: 6 + 6 =..."

Everything test worked fine except, Little Professor displays number of problems correct Cause: Did not find "9" in "Level: 6 + 6 =..." def main(): level = get_level() ...
techno adnan's user avatar
1 vote
1 answer
195 views

Little Professor display number of problems correct

Providing the whole code i cant spot what causing this error tried already shifting etc python tutor and rewriting getting back to the same spot. Can you spot whats wrong?? import random def main(): ...
Alkir man's user avatar
0 votes
1 answer
116 views

scourgify.py problem

I wrote this code for scourgify.py :- import sys import csv import os if len(sys.argv) < 3: sys.exit("Too few Command-line argument") elif len(sys.argv) > 3 : sys.exit(...
Alaa Hamoush's user avatar
1 vote
1 answer
192 views

pset9 finance check 50 :( sell handles valid sale

Hi I am working on Cs50 2023/psets/9/finance/ I have looked at this problem and have rewritten the code multiple ways but can't get past this error in the check. I think I have gotten too close to the ...
Leyzer's user avatar
  • 13
1 vote
1 answer
183 views

pizza.py unclear problem when submitting

from tabulate import tabulate import sys import os if len(sys.argv) < 2: sys.exit("Too few Command-line argument") elif len(sys.argv) > 2 : sys.exit("Too many ...
Alaa Hamoush's user avatar
0 votes
0 answers
111 views

Pset 9 Finance: expected to find ¨112.00¨in page, but it wasn´t found

I have been tinkering around with Pset 9 Finance for a few days now, but somehow I am unable to pass check50 even when my website looks the same and works correctly. Whys is check50 giving the error : ...
Asaz1el's user avatar
1 vote
1 answer
217 views

test_plates.py problem

What is the problem with my code for testing plates.py? this is the code : def main(): plate = input("Plate: ") if iss_valid(plate): print("Valid") else: ...
Alaa Hamoush's user avatar
0 votes
1 answer
90 views

CS50P Little Professor error

please what is the problem with this code and why is it displaying this particular error? :( Little Professor displays number of problems correct expected "9", not "Level : 6 + 6 ...&...
Alaa Hamoush's user avatar
0 votes
2 answers
357 views

question in CS50P course on lines.py

I have this assignment: "In a file called lines.py, implement a program that expects exactly one command-line argument, the name (or path) of a Python file, and outputs the number of lines of ...
Alaa Hamoush's user avatar
0 votes
0 answers
87 views

Problem with CS5 Problem Set 1 - Meal Time

enter image description here I can get the right out put when I enter the example input, but I can not get the code to pass the cs50 test. Can someone please help me with this? def main(): ...
Opie Taylor's user avatar
0 votes
2 answers
30 views

The code allways prompt to enter a new date when entering the date. How to correct my code in order to have the right answer?

import re months = [ "January", "February", "March", "April", "May", "June", "July", "August&...
Horace's user avatar
  • 1
0 votes
1 answer
44 views

problems with little professor not rejecting inputs that check50 says it should

When I run locally the program behaves as I think it should. But when I run it through check50 it fails saying that I dont reject inputs that I should reject. import random def main(): while True:...
Mathika Wariyapperuma's user avatar
0 votes
1 answer
130 views

Meal Time issues

I'm doing the problem set 1 on CS50P course and on the "Meal Time" problem I can't get a check from check50. The code runs fine if I test manually but check50 returns 'cant check until a ...
FSZer0's user avatar
  • 3
0 votes
1 answer
197 views

game.py rejects out-of-range level expected program to reject input, but it did not!

Here's my code: while True: try : level = int(input("Level: ")) # guess = int(input("Guess: ")) except ValueError: pass ...
MD AKRAM's user avatar
0 votes
0 answers
29 views

cs50p final project: find a partner to collaborate on the project to-do list with pomodoro

I have finished the whole cs50p almost listening to the lecture and completing the problem set independently except for the final project. Meanwhile, I have learned SQL and web in cs50x, not finished. ...
Xiao Li's user avatar
0 votes
1 answer
58 views

Check50 says my answer is wrong. Why? Outdated.py pset3

Issue: Check50 output: My code isn't the cleanest or most optimized, but I'm pretty sure it works. def main(): day = 4000 months = [ "January", "February", &...
I'm Confused's user avatar
0 votes
1 answer
473 views

cs50 Problem set 2: camelCase

I'm trying to make the "camelCase" problem but i'm stuck. I don't understand how to print a _ when there is a uppercase letter in the input. Could you give me some tips? This is the code ...
Zeger Bleyen's user avatar
0 votes
1 answer
183 views

Refueling - problem set 5 - CS50

I have a problem with refueling from problem set 5 of cs50p. I tried and implement a lot of version of the code, always good enough to do the job and pass the test but check50 fails. I give fuel.py ...
domionico's user avatar
0 votes
2 answers
105 views

einstein.py check50 says I am returning '2'

Check50 says I am returning '2' but I do not think this is the case. I have also tried changing the order in which I print/return to see if it is expecting something different the error messages are ...
ifajardo's user avatar
0 votes
0 answers
146 views

bitcoin excersise problem set 4

the code works in my pc but check50 find this error and I don't understand why: Traceback (most recent call last): File "/tmp/tmptndsrole/test_two_coins/testing.py", line 28, in bitcoin....
domionico's user avatar
-1 votes
1 answer
279 views

CS50P PSet5 Refueling

:( correct fuel.py passes all test_fuel checks expected exit code 0, not 1 when testing my code, which then prevents the following tests from running Here is my code for fuel.py: def main(): ...
Edward Burroughs's user avatar
0 votes
1 answer
219 views

Why am I failing check50, Cs50p Little Professor

I get this reply after executing check50: :) professor.py exists :( Little Professor rejects level of 0 expected program to reject input, but it did not :( Little Professor rejects level of 4 ...
Mikail Kuehl's user avatar
0 votes
1 answer
62 views

Problem Set 4 Little Professor ,expected output doesn't show

I'm solving this problem enter link description here My code doesn't pass automated test enter link description here import sys import random def main(): get_level() def get_level(): while ...
Abhisehk_lp's user avatar