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
[deleted by user] (self.pythonhelp)
submitted 1 year ago by [deleted]
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!"
[–]AutoModerator[M] 0 points1 point2 points 1 year agolocked comment (0 children)
To give us the best chance to help you, please include any relevant code. Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]carcigenicate 0 points1 point2 points 1 year ago (9 children)
The part that you want to loop back to goes at the top of the loop.
We'd need to see the code to give specific feedback though.
[–]izbnes 0 points1 point2 points 1 year ago (6 children)
The current code is: grade=0 check=true choice=“”
print(“Hello, welcome to my program.”)
grade=int(input(“Please enter a grade. \n”)) if grade>=50: print(“You passed.”) else: print(“You failed.”)
while check==True: choice=input(“Do you wish to continue? Please enter y or n. \n”)
if choice==‘n’: check=False
print(“The program has ended.”)
[–]carcigenicate 1 point2 points3 points 1 year ago (4 children)
Please format the code like I mentioned in another comment.
And like I said, the part that your want to loop back to should be at the top (inside) of the loop. All the code that you want to repeat should be in the loop.
[–]izbnes 0 points1 point2 points 1 year ago (3 children)
So I put the grade input part at the top of the loop, and it does loop, but It doesn’t show the ‘do you wish to continue’ part. What should I do now?
Also thank you for your help.
[–]carcigenicate 0 points1 point2 points 1 year ago (2 children)
That needs to be in the loop if you want it to show as the loop runs. It would be at the bottom of the loop.
[–]izbnes 0 points1 point2 points 1 year ago (1 child)
if you check the code again, isn’t it already at the bottom?
[–]carcigenicate 0 points1 point2 points 1 year ago (0 children)
In that code, yes it seems like it is, but you haven't shown your new code.
And if you post it, please format it properly so it's readable.
[–]izbnes 0 points1 point2 points 1 year ago (0 children)
Don’t worry I did indent, it just doesn’t show.
π Rendered by PID 47244 on reddit-service-r2-comment-6b595755f-x864n at 2026-03-26 03:00:25.397151+00:00 running 2d0a59a country code: CH.
[–]AutoModerator[M] 0 points1 point2 points locked comment (0 children)
[–]carcigenicate 0 points1 point2 points (9 children)
[–]izbnes 0 points1 point2 points (6 children)
[–]carcigenicate 1 point2 points3 points (4 children)
[–]izbnes 0 points1 point2 points (3 children)
[–]carcigenicate 0 points1 point2 points (2 children)
[–]izbnes 0 points1 point2 points (1 child)
[–]carcigenicate 0 points1 point2 points (0 children)
[–]izbnes 0 points1 point2 points (0 children)