jeudi 18 juin 2020

Program ends after inputting an integer when it asks 'how old are you'

print('Hi there, what is your name')
name = input()

if name == 'Alice':
    print('Hello, Alice')
if name != 'Alice':
    print('how old are you?')
    age = int(input())
elif age < 12:
    print('You are not Alice Kiddo.')
elif age > 2000:
    print('Unlike you, Alice is not an undead, immortal vampire.')
elif age > 100:
    print('You are not Alice, Grannie.')

When I run the program I get

Hi there, what is your name
Jeff
how old are you?
5

Process finished with exit code 0

Aucun commentaire:

Enregistrer un commentaire