A book recommended from your professor is a reliable source of information.
They’re right, most of the time the question you ask can confuse them or you may say it incorrect etc.
I feel like it is best to mess with it some with pictures you don't care about so you can see what would and what doesn't. that is how my sister did it and she take some grad pics. there are probably classes to
Answer:
from random import randint
num = randint(1,10)
count =0
while count<3:
userNum = int(input("Guess a Number "))
if num ==userNum:
print("You won")
break
else:
print("Wrong try again")
count = count+1
Explanation:
Import randint from random
generate a random number between (1,10) and assign to num
create a loop control variable count set to 0
In a While statement with the condition count<3 prompt user to make a guess
if guess is correct print you won and break
else print wrong try again and increase count by 1