为什么语句不在elif表达式中运行?

时间:2019-06-25 16:43:46

标签: python python-3.x

为什么语句不在elif表达式中运行?

print('Calculating Age')
birth_year=input("Input Your Birth Year:")
age=2019-int(birth_year) 
print(age)
print('Your Age is ' + str(age)) 

'''问题从这里开始'''

check=input("Which Variable type do you want you know? \n Type 'B' for birth_year and 'A' for age:  ")
if check=='b' or 'B':
    print("You Selected birth_year.Type is given bellow")
    print(type(birth_year)) 
elif check=='a' or 'A':     
    print("You Selected age.Type is given bellow")
    print(type(age)) 
else:
    print('Wrong Character')

0 个答案:

没有答案