Skip to content

Instantly share code, notes, and snippets.

@Looons404
Created June 27, 2025 10:27
Show Gist options
  • Select an option

  • Save Looons404/a2ef7f7183f6c6ba802539a266091b9f to your computer and use it in GitHub Desktop.

Select an option

Save Looons404/a2ef7f7183f6c6ba802539a266091b9f to your computer and use it in GitHub Desktop.
Simple guess the number game in python.
import random
number = random.sample(range(1, 10), 1)[0]
user = int(input("Entrez un nombre entre 1 et 9: "))
if user == number:
print("Congrat, you've found the correct number !")
else:
print("Sorry, this isn't the right number.")
print(f"The number was {number}.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment