It creates all the files into a map, but once i start the .exe file it closes right away.
Idk what i should do with this problem..
The source i compiled :
import random
def main():
ranNum = (random.randint(1, 100))
howGue = 0
while True:
choice = int(input ("Guess what the number is (1/100): "))
if (choice > 100):
print ("That's not a valid number, guess between 1 and 100")
elif (choice < ranNum):
howGue +=1
print ("Too low, try again")
elif (choice > ranNum):
howGue +=1
print ("To high, try again")
elif (choice == ranNum):
howGue +=1
print ("You got the right number")
print ("The Number was : ", ranNum)
print ("You Guessed ", howGue , " Times")
break
elif (choice > 101):
print ("That's not a valid number, guess between 1 and 100")
else:
print ("Not a valide number")
print ("Welcome to PyGuess")
main()
again = input ("Would you like too run the program over again Y/N?")
if again == "Y":
main()
elif again == "y":
main()
else:
stop = input ("Okay, Take care and come again!")
Thanks in advance

New Topic/Question
Reply




MultiQuote


|