Skip to content

Instantly share code, notes, and snippets.

@ariedov
Created June 8, 2024 08:37
Show Gist options
  • Save ariedov/a17a972c346df431d555a768bab0da54 to your computer and use it in GitHub Desktop.
Save ariedov/a17a972c346df431d555a768bab0da54 to your computer and use it in GitHub Desktop.
Simple python game "Guess the number"
import random
rand = random.randint(0, 10)
print(f"Я загадав число!")
while True:
guess = int(input("Вгадуй!"))
print(f"Ти вважаєш що {guess}?")
if guess == rand:
print("Вгадав!")
break
if guess != rand:
print("Не вгадав, спробуй ще!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment