+ 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)
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!")
+ 2
That sure is the toughest code anyone would ever write ,if soneone wrote it for ya .
+ 2
agreed!
+ 2
I didn't close that loop.. so consider that