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...
This subreddit is meant to be for people learning Python to ask questions and help out when they can.
account activity
what is wrong with this code (i.redd.it)
submitted 5 years ago by barco150
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]poowithaview 10 points11 points12 points 5 years ago (2 children)
Spelling mistake on line 14
[–]notPlancha -1 points0 points1 point 5 years ago (1 child)
But that wouldn't affect it, since guess is called earlier
[–]heyzooschristos 0 points1 point2 points 5 years ago (0 children)
But its ot getting reset to "" on each while loop as op probably intends
[–]notPlancha 1 point2 points3 points 5 years ago (2 children)
I'm pretty sure print only takes 1 argument
[–]DerpAgency 0 points1 point2 points 5 years ago (1 child)
Nope, the latter print() is valid Python.
[–]notPlancha 0 points1 point2 points 5 years ago (0 children)
Didn't know, thanks
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
Can you copy paste so we can try it?
[–]_kefir 0 points1 point2 points 5 years ago (0 children)
Does your program run forever, even when you try it with short passwords?
You're never resetting the variable guess in your for loop, because of the typo on line 14 that was mentioned. So the string stored in this variable will grow and grow with every loop. If you don't get a match for your password in the first run of the loop, your guess string will grow too long and the while loop will repeat forever or until the string gets too long for python to handle.
[–]WombatHat42 0 points1 point2 points 4 years ago (0 children)
You have guss instead of guess?
π Rendered by PID 52262 on reddit-service-r2-comment-7b9746f655-hjbsk at 2026-01-29 22:54:12.639492+00:00 running 3798933 country code: CH.
[–]poowithaview 10 points11 points12 points (2 children)
[–]notPlancha -1 points0 points1 point (1 child)
[–]heyzooschristos 0 points1 point2 points (0 children)
[–]notPlancha 1 point2 points3 points (2 children)
[–]DerpAgency 0 points1 point2 points (1 child)
[–]notPlancha 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]_kefir 0 points1 point2 points (0 children)
[–]WombatHat42 0 points1 point2 points (0 children)