About the assignment of GUESS?

import random
times = 3
secret = random.randint
print ("- I love fish C studio -")
guess = 0
print ("guess which number the little turtle has in mind now:", end= ")
while (guess! = secret) and (times > 0):

temp = input()
guess = int(temp)
times = times - 1 -sharp -1
if guess == secret:
    print("")
    print("")
else:
    if guess > secret:
        print("~~~")
    else:
        print("~~~")
    if times > 0:
        print(":", end=" ")
    else:
        print("T_T")

print ("Game over, don"t play ^ _ ^")

question: why do you assign a value of 0 to GUESS in the code in the first place? What is the effect of this?

Mar.07,2021
The variable guess, defined by

is convenient to be called later by the program. The value of
guess can be arbitrary, such as guess = None, because int (temp) will be reassigned later.


because you are useful in while (guess! = secret) and (times > 0): if guess, is not declared earlier, an error will be reported.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b9ad-2b60d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b9ad-2b60d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?