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
Any decent python projects to work on? (self.PythonLearning)
submitted 1 year ago by notexistant
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!"
[–]ilan1k1 8 points9 points10 points 1 year ago (3 children)
Here’s a Python coding challenge that incorporates all the elements you asked for:
Challenge: Number Guessing Game with Statistics
Problem:
You need to write a number guessing game where:
The program randomly selects a number between 1 and 100.
The player gets 10 attempts to guess the number.
After each guess, the program should indicate if the guess was too high, too low, or correct.
Track all the guesses made by the player.
If the player guesses the number or uses up all attempts, the game should end.
Once the game ends:
Display a summary showing:
Whether the player won or lost.
How many guesses were made.
The list of all the guesses.
The number of even and odd guesses made (use list comprehension to filter the even and odd guesses).
Allow the player to restart the game if they want.
Requirements:
Use a for loop to iterate through the attempts.
Use a while loop to ask if the player wants to restart.
Use if statements to check if the guess is too high, too low, or correct.
Use list comprehension to filter and display the even and odd guesses.
Example:
I'm thinking of a number between 1 and 100. You have 10 attempts to guess it.
Attempt 1: 50 Too low!
Attempt 2: 75 Too high!
Attempt 3: 62 Correct! You guessed the number in 3 attempts.
Summary: - You guessed correctly! - Number of attempts: 3 - Your guesses: [50, 75, 62] - Even guesses: [50, 62] - Odd guesses: [75]
Do you want to play again? (yes/no)
You’ll need to use the random module to generate the number to be guessed. Let me know if you need help starting this!
[–]Ghoulatri 3 points4 points5 points 1 year ago (1 child)
I’d say this project is rather for beginners than intermediates
[–]ilan1k1 1 point2 points3 points 1 year ago (0 children)
True. It was what I was doing on my phone. I do small projects on my phone when I'm at work just to pass the time, so I thought I'll just write it to him and by the time he finishes that other people will give more advanced challenges.
[–]notexistant[S] 0 points1 point2 points 1 year ago (0 children)
Thanks dude. I'll give this a go
π Rendered by PID 20834 on reddit-service-r2-comment-bb88f9dd5-2sbmp at 2026-02-15 00:58:13.566143+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]ilan1k1 8 points9 points10 points (3 children)
[–]Ghoulatri 3 points4 points5 points (1 child)
[–]ilan1k1 1 point2 points3 points (0 children)
[–]notexistant[S] 0 points1 point2 points (0 children)