Quick actions

cmd+k|ctrl+k

Navigation

Languages

Number Guesser Module

Snippet info

Language

Python

Visibility

public

Author

wang.andison

Created

2026-06-22T19:05:46.126401Z

Updated

2026-06-22T19:05:46.126401Z

import random

secret_number = random.randint(1, 10)

guess = int(input("Guess a number from 1 to 10: "))

if guess == secret_number:
    print("You win!")
else:
    print("You lose!")
    print("The number was", secret_number)
INFO