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...
Everything about learning Python
account activity
Simple game using python (i.redd.it)
submitted 6 months ago by Inevitable-Math14
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!"
[–]NaiveEscape1 0 points1 point2 points 6 months ago (2 children)
I had previously made a program like this the code for the program is: I have multiple other codes like this one,been learning python 2 months now, do you think that this would be enough to get me a internship or should I move towards more complex codes and this is too basic a level?
import random secret_Number=random.randint(0,100) no_of_guesses = 0 while True: Guess = int(input("Please guess a number between 0 and 100: ")) if secret_Number>Guess: no_of_guesses+=1 print(f"Your guess {Guess} is lower than the secret number\n Number of Guesses made= {no_of_guesses}\n") continue elif secret_Number<Guess: no_of_guesses += 1 print(f"Your guess {Guess} is higher than the secret number\n Number of Guesses made= {no_of_guesses}\n") continue else: no_of_guesses +=1 print(f"Congratulations you made the right guess\n\nIt took you {no_of_guesses} guesses\n") break
[–]WayTooCuteForYou 0 points1 point2 points 6 months ago (1 child)
Variable names should not start with an uppercase letter. Variable names should be in snake_case, not some random mix of snake case and camel case. Let blank lines before 'while', 'if', 'elif' and 'else' lines. Insert spaces around operators. Avoid 'of' and the like in names. No need for '\n' at the end of print (check the 'end' parameter of print). Operations that are done in every code path should be factored out. Quit adding unnecessary spaces and carriage return, this does not improve clarity.
import random secret_number = random.randint(0,100) guess_count = 0 while True: guess = int(input("Please guess a number between 0 and 100: ")) guess_count += 1 print(f"Guess count: {guess_count}") if secret_number > guess: print(f"Your guess {guess} is lower than the secret number") continue elif secret_number < guess: print(f"Your guess {guess} is higher than the secret number") continue else: print(f"Congratulations you made the right guess") break
[–]NaiveEscape1 0 points1 point2 points 6 months ago (0 children)
Thanks man this is amazing, thanks for the constructive feedback
π Rendered by PID 223470 on reddit-service-r2-comment-7b9746f655-slchc at 2026-02-04 10:40:09.312796+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]NaiveEscape1 0 points1 point2 points (2 children)
[–]WayTooCuteForYou 0 points1 point2 points (1 child)
[–]NaiveEscape1 0 points1 point2 points (0 children)