Questions tagged [python]

Code using the python language.

Filter by
Sorted by
Tagged with
0 votes
1 answer
19 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
0 answers
28 views

CS50p - PSet4 - Adieu - Exit code 1

So, I have supposedly finished my code for the Adieu exercise from Problem Set 4. I tested all of the inputs that check50 uses and I get the right feedback from my code. However, when I run check50 it ...
PquePC's user avatar
  • 1
0 votes
1 answer
52 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
30 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
14 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
1 vote
2 answers
34 views

Week 9 - Finance - Foreign Key Mismatch

I'm trying to solve this issue for a week and nothing works! in my /buy route, I cannot update the users table with updated cash after a "buy" order is submitted. Here is an example of what ...
Julia 's user avatar
  • 21
1 vote
1 answer
56 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
75 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
28 views

:( np_chunk finds noun phrases that don't contain other noun phrases

check50 keep showing that there is a problem even though when I checked it with all 10 sentences it work. It expected the outcome: {'holmes', 'the home'} but my output shows: {'the armchair in the ...
ATLAS's user avatar
  • 1
0 votes
1 answer
23 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
66 views

CS50AI - Parser :( np_chunk finds noun phrases that don't contain other noun phrases

check50 keeps showing that there's a problem with my code ":( np_chunk finds noun phrases that don't contain other noun phrases", but I can't see what I am doing wrong. Please help me check ...
Eva Chen's user avatar
-1 votes
1 answer
48 views

I can not get Check50 to pass "buy handles valid purchase ..." for pset9 finance

Sorry for the messy code. I have been debugging for a few days now. Duck say everything is OK but it will not pass. All the math works out Cash is displayed on the main page under the stock buys. No ...
user41019's user avatar
-1 votes
1 answer
40 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
38 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
12 views

Testing my code on files I created works. CS50 check gives a fail. It seems to make my code count 2 more when comments are checked

import sys def main(): checkfile = check(sys.argv) try: with open(checkfile , "r") as fl: list_lines = fl.readlines() except FileNotFoundError : sys....
Ingrid 's user avatar
0 votes
1 answer
34 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
74 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() ...
Adnan's user avatar
  • 13
0 votes
1 answer
61 views

pset 9 finance :( sell page has all required elements

i searched around for this type of error and looked at my code, but was not able to figure it out. I had something very similar when debugging the buy function and used a similar process for the sell ...
Xenoshell's user avatar
1 vote
1 answer
108 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
69 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
129 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 votes
1 answer
22 views

sqlite optional error message when inserting users input inti db

When I run flask, I get the following error meassage: sqlite3.OptionalError: near "years": syntax error the error mesasge is placed in "cursor.execute(query1)" However, I do not ...
user40089's user avatar
0 votes
1 answer
106 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
12 views

Cannot use Check50 or Submit50

I just started CS50 Introduction to Phyton and I cannot execute check50 or submit50. It gives me an error and I pretty much tried everything. It says to enable access, please visit submit.cs50.io. But ...
Zeynep Çelikten's user avatar
0 votes
0 answers
86 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
135 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
2 answers
158 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
1 answer
32 views

pset 9 finance Runtime Error: unsupported value:{'id', 4}

I'm working on pset 9 finance. I have my index nearly done but get an error when a new user logs in. Here is my code for index: app.route("/") @login_required def index(): ""&...
KateOz's user avatar
  • 1
0 votes
0 answers
55 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
131 views

scourgify Lesson6 Problem Set check50 errors

Description I have been working on this solution for a couple of weeks now. I wrote the code to satisfy all requirements described in the problem set in about three hours. The rest of the time has ...
Seamus Connolly's user avatar
0 votes
0 answers
26 views

What does 'NoneType' error mean?

In finance, I am getting the following error: sending POST request to /register exception raised in application: TypeError: expected string or bytes-like object, got 'NoneType' Why am I getting this ...
Sakib Arifin's user avatar
0 votes
1 answer
90 views

CS50AI Crossword

So I've been working on the CS50Ai Crossword problem for about a day and a half, and after pouring through my entire code several times, I have been unable to fix a bug with my consistent function. ...
Patrick Connolly's user avatar
0 votes
2 answers
26 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
0 answers
29 views

Finance question. expected status code 200, but got 400 for register route

@app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" if request.method == "POST" : ...
Bunn Bunn's user avatar
0 votes
1 answer
66 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
25 views

load_data function does not accept/process all of the data types it should be processing

I am working on the CS50AI "Shopping" project and received the following comments from the grader. I have checked the specification carefully but didn't spot any issue. The output seems to ...
David Lau's user avatar
0 votes
0 answers
15 views

CS50W Project 1- MultiValueDictKey error when trying to save edits

I am currently doing the Project 1- Django on CS50W (Wiki project). I was able to render the edit page, but I got the "MultiValueDictKey" error when trying to save the edits. This is my ...
valen's user avatar
  • 1
0 votes
0 answers
77 views

CS50 P-Shirt problem in Unit on File I/O. My output seems exactly as expected, however Check50 declares that the Image does not match

I have imported numpy to extract the mask. Is that not acceptable? with Image.open("shirt.png") as paste_img: a= np.asarray(paste_img) mask = a[:,:,3] img_mask = Image.fromarray(...
Anjali1691's user avatar
0 votes
0 answers
98 views

Little Professor check50 shows error even though program run completely fine

I'm facing an annoying issue while trying to validate my Little Professor results. I've ran the program several times and it does run as per the specs however when running the check50 it keeps on ...
Gilardino's user avatar
0 votes
1 answer
44 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
0 answers
81 views

The installed cs50 library for python doesn't work on my Visual Studio Code on my Desktop

I've tried to set up Visual Studio Code on my Desktop for my final project (My online codespace is running out of storage), but despite having downloaded the cs50 library as follows pip3 install cs50 ...
Ganymede's user avatar
0 votes
0 answers
38 views

Question About Using SQL on Desktop Visual Studio Code

I am at week7 and I wanted to use SQL on my desktop Visual Studio code(which i successfully installed. I actually switch the Python version to 3.7.0 when running this, which removed the underline ...
TrytoLearn's user avatar
0 votes
1 answer
168 views

I am trying to tackle the einstein code problem 0 CS50’s Introduction to Programming with Python

I keep getting the error code : input of 1 yields output of 9000000000000 expected........ this is the code i wrote Defining the main def main(): m = int(input("How many kg's are squared with E+...
Paul McCormick's user avatar
0 votes
1 answer
17 views

can't seem to figure out the problem with the sell route code

can't seem to figure out the problem with the sell route code that check50 indicates this is my sell route code: @app.route("/sell", methods=["GET", "POST"]) @...
Michael's user avatar
0 votes
2 answers
66 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
-1 votes
1 answer
184 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
51 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
0 votes
1 answer
163 views

DNA Week 6 | Issues

I have been working on this DNA problem for a while now, and I do not understand what causes the many problems. Right now there are just some technical problems, for example saying "No match"...
Berra Eylül Toprak's user avatar
1 vote
1 answer
397 views

Lab 6 World-Cup | Timed out issue

Check50 says, and I qoute, "timed out while waiting for program to exit" in some of the criterias, I don't understand what infinite loop is causing this. Can you help? # Simulate a sports ...
Berra Eylül Toprak's user avatar
1 vote
1 answer
239 views

Seasons of love doesn't pass the test_seasons.py

I'm having problems passing the test_seasons.py on check50, if I run "pytest test_seasons.py" all the seven tests I have pass but if I run the command of "check50" it shows red. My ...
santiago gordillo's user avatar

1
2 3 4 5
9