+ 3

Program that picks a random number from 1-100

it should ask the user to guess a number. tell the user is the answer is higher or lower than the number they guessed, or if correct answer. allow infinite number of guesses. to generate my number I did from random import randint randomNum = randint (1,100)

8th Jun 2017, 5:17 PM
Talia Pacelli
Talia Pacelli - avatar
4 Antworten
+ 1
import random num=random.randint(1,100) run=true while run: guess=int(input("Enter a number")) if guess > num: print("Too High") continue if guess < num: print("Too Low") continue if num==guess: print("You Got It!")
8th Jun 2017, 6:01 PM
LordHill
LordHill - avatar
+ 2
That sure is the toughest code anyone would ever write ,if soneone wrote it for ya .
8th Jun 2017, 5:27 PM
Kash
Kash - avatar
+ 2
agreed!
8th Jun 2017, 5:46 PM
Talia Pacelli
Talia Pacelli - avatar
+ 2
I didn't close that loop.. so consider that
8th Jun 2017, 7:02 PM
LordHill
LordHill - avatar