Write a python program to guess a number between 1 to 9
Answers
Answered by
0
Answer:
Explanation:
import random
print random.randint(0,9)
Just you need to import random module and use its inbuilt function
randint(0,9) will generate any number from 1,2,..,9
Hope it helps :-)
Answered by
2
Answer:
import random
number = int(input("enter:"))
if 10 > number > 0:
print("Right!")
else:
print("wrong!")
Explanation:
I believe this is the simplest way to solve this as it doesn"t need 'for' loop
Similar questions