I am building a function, but the function doesn't work the way it should.
def correct_number():
wPlayer = input("Choose a number. ")
while wPlayer is not int:
notint = 0
try:
wPlayer = int(wPlayer)
except ValueError:
print("You didn't enter a number.")
wPlayer = input("Choose a number. ")
notint = 1
if (notint != 1):
if wPlayer <= 0:
print('Please enter a number bigger than zero.')
wPlayer = input("Choose a number. ")
wPlayer += 12
if wPlayer <= 82:
wPlayer = 82
print("Your number is now 82.")
try:
num = 12 - wPlayer
if num < -70:
wPlayer -= num
elif num > -70:
wPlayer -= 1
print("Your number is now", wPlayer)
correct_number()
print('The Program Has Ended.')
When I run this program, and I meet the while statement's requirements, it doesn't print anything else, even the print
right below the function call. Why is this? What am I doing wrong?