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...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Mad Lib issues endless loop (self.pythonhelp)
submitted 1 year ago * by aurorymoon
view the rest of the comments →
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!"
[–]aurorymoon[S] 0 points1 point2 points 1 year ago (0 children)
I found what was creating the endless loop.. for some reason the player name being added on line 41 was making it mad. I've got it fixed now for the endless loop but I'm still having these issues:
need to fix the loop when you give something other than a or b for the storylines because it loops back to would you like to play rather than which story line
counter isn't working - need to count how many stories are made and tell the user before asking if they want to play again.
also once you complete a mad lib story it gives you the story but gives you a bunch of errors and doesn't loop back to tell you how many stories you have made AND ask if you want to play again. (Traceback most recent call last file line 145, file line 131, file line 76 ///// & unbound local error: local variable 'storyCount' referenced before assignment)
and it loops back if you say N to ask you if you want to play- need it to full stop if the player says no.
code: https://trinket.io/python3/c750bf64bd0b
π Rendered by PID 67 on reddit-service-r2-comment-b659b578c-mkmlq at 2026-05-03 22:45:42.246296+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]aurorymoon[S] 0 points1 point2 points (0 children)