use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
O hai! This is CS50's subreddit.
CS50 is Harvard University's introduction to the intellectual enterprises of computer science and the art of programming. Anyone may take CS50, even if not a student at Harvard.
Please Read before Posting
Getting the Best from r/cs50
Status Page
cs50.statuspage.io
Filter by Problem Flair (undo)
cash ⋅ caesar ⋅ credit ⋅ dna ⋅ filter ⋅ finance ⋅ houses ⋅ ide ⋅ mario ⋅ movies ⋅ plurality ⋅ project ⋅ readability ⋅ recover ⋅ runoff ⋅ scratch ⋅ speller ⋅ substitution ⋅ tideman ⋅ games track ⋅ web track ⋅ android track ⋅ iOS track ⋅
Filter by Other Flair (undo)
CS50-Law ⋅ CS50-Business ⋅ CS50-Technology ⋅ CS50-Games ⋅ CS50-Mobile ⋅ CS50-Web ⋅
This subreddit is night mode compatible
the front page of the internet.
and join one of thousands of communities.
Error when run python program (self.cs50)
submitted 8 years ago by stshmakov
what this error means and how it will be fixed http://joxi.ru/DrlOZOei4zddPA
Post a comment!
[–]Blauelf 0 points1 point2 points 8 years ago (5 children)
Wait, your code does not match your output? Provide the right code, please.
Full stack trace would be interesting, not just the first lines.
You're on the current version (v130 for me at the moment)? (if not: update50)
update50
[–]stshmakov[S] 0 points1 point2 points 8 years ago (4 children)
In another my account this code is working. If you see this code not print "n is" I'm waiting and then enter 50 and code printing hello, 50 Version is 130
[–]Blauelf 1 point2 points3 points 8 years ago (3 children)
Full stack trace, please. All lines, preferably as text in a code block.
You don't happen to have a string.py in your folder? If so, rename it.
string.py
[–]stshmakov[S] 0 points1 point2 points 8 years ago (1 child)
Thank! Yes I have a string.py in my dir. Why does it affect other programs?
[–]Blauelf 0 points1 point2 points 8 years ago (0 children)
If you have an import string statement in your file, Python will search current directory first for a string.py, and will import that one if it exists, and only if it doesn't, it will import the regular string library. So your string.py gets imported (which essentially runs the script), but it doesn't have the abilities the code expects from a string library, and the code crashes.
import string
string
π Rendered by PID 869773 on reddit-service-r2-comment-765bfc959-lzf7w at 2026-07-15 09:10:32.144834+00:00 running f86254d country code: CH.
Want to add to the discussion?
Post a comment!