Nov-02-2018, 10:06 PM
import random def game(ranNum, numGuesses=10): pick = int(input("Enter a number ----> ")) if pick > ranNum: print("Too high try again. " + str(numGuesses - 1) + " trys remaining") numGuesses -= 1 game(ranNum) elif pick < ranNum: numGuesses -= 1 print("Too low try again. " + str(numGuesses - 1) + " trys remaining") game(ranNum) elif pick == ramNum: print("You Won! With a total of " + str(numGuesses) + " trys remaining") game(random.randint(0, 100))Anytime I guess a number, the output is always 9 trys remaining. I would like it to count down from 10 to 0. Any help is appreciated!