Record your races with a typeracer account:
Create Your Account- Save your race history and scores.
- Customize your profile and racecar.
- It’s free, why not?
Race Result Details |
Racer | Sohil (ozwizardd) |
Race Number | 3 |
Date | Thu, 4 Jul 2024 18:22:12 +0000 |
Universe | code |
Speed |
36 WPM
![]() |
Accuracy | 92.3% |
Rank | 1st place (out of 3) |
Text typed:
|
import random
n = random.randint(1, 99)
guess = int(raw_input("Enter an integer from 1 to 99: "))
while n != "guess":
print
if guess < n:
print "guess is low"
guess = int(raw_input("Enter an integer from 1 to 99: "))
elif guess > n:
print "guess is high"
guess = int(raw_input("Enter an integer from 1 to 99: "))
else:
print "you guessed it!"
break
print
— Guessing Game
|