I have set the guess_limit to 6 and random.randint(0, 6), even if I guess 1,2,3,4,5,6, it will always return "Out of guesses!" So my question is does random.randint() is calling the function or there is no random number if the function is not called. Please help
import random
guess = ""
guess_limit = 6
guess_count = 0
out_of_guesses = False
hiden_number = random.randint(1, 6)
while guess != hiden_number and not (out_of_guesses):
if guess_count < guess_limit:
guess = input("Enter the number: ")
guess_count += 1
else:
out_of_guesses = True
if out_of_guesses:
print("Out of guesses!")
else:
print("You Win")
Enter the number: 1
Enter the number: 2
Enter the number: 3
Enter the number: 4
Enter the number: 5
Enter the number: 6
Out of guesses!
"If the random.randint(1, 6) range is 1 to 6 how is it possible that I am missing to guess the random number"