流程控制之if...else

#_*_coding:utf-8_*_

# 如果:女人的年龄 > 30岁,那么:叫阿姨

# age_of_girl = input('Please enter your age:')
# age_of_girl = int(age_of_girl)
#
# if age_of_girl > 30:
# print('Aunt')

# 如果:女人的年龄 > 30岁,那么:叫阿姨,否则:叫小姐姐

# age_of_girl = input('Please enter your age:')
# age_of_girl = int(age_of_girl)
#
# if age_of_girl > 30:
# print('Aunt')
# else:
# print('Beautiful Girl!')

# 如果:女人的年龄 >= 18并且 < 22岁并且身高>170并且体重<100并且是漂亮的,那么:表白,否则:叫阿姨

# age_of_girl = input('Please enter your age:')
# age_of_girl = int(age_of_girl)
# height = input('Please enter your height:')
# height = int(height)
# weight = input('Please enter your weight:')
# weight = int(weight)
# pretty = input('Are u pretty?[True or False]:')
#
# if age_of_girl >= 18 and age_of_girl < 22 and weight < 100 and pretty == True:
# print("I'm falling in love")
# else:
# print("Hey Old Aunt!")

# 如果:表白成功,那么:在一起,否则:打印qnmlgb的爱情
# age_of_girl = input('Please enter your age:')
# age_of_girl = int(age_of_girl)
# height = input('Please enter your height:')
# height = int(height)
# weight = input('Please enter your weight:')
# weight = int(weight)
# pretty = input('Are u pretty?[Yes or No]:')


# if age_of_girl >= 18 and age_of_girl < 22 and height>170 and weight < 100 and pretty == 'Yes':
#
# print("I'm falling in love")
# girl_said = input('What the girl said?[Yes or NO]:')
#
# if girl_said == 'Yes':
# print("good!")
# else:
# print("Oh shit! Old Aunt!")
# else:
# print('Hey Old Aunt!')

# 如果:成绩》=90,那么:优秀
# score = input('Please enter your score:')
# score = int(score)
# if score >= 90 :
# print('A')
# elif score >=80 and score < 90:
# print('B')
# elif score >=70 and score < 80:
# print('C')
# else:
# print('Failure is the mother of success')

#练习一:用户登录验证
# username = input('Please enter your username:')
# password = input('Please enter your password:')
#
# if username == 'oOC' and password == '123456':
# print('login success')
# else:
# print('Please try again.')

#练习二:根据用户输入内容输出其权限
# name=input('请输入用户名字:')
#
# if name == 'egon':
# print('超级管理员')
# elif name == 'tom':
# print('普通管理员')
# elif name == 'jack' or name == 'rain':
# print('业务主管')
# else:
# print('普通用户')

#练习三:上班OR出去浪
# today = input('Today is __??__:')
#
# if today in ['Saturday','Sunday']:
# print('Enjoy the time!')
# elif today in ['Monday','Tuesday','Wednesday','Thursday','Friday']:
# print('go to work')
# else:
# print('''
# Monday
# Tuesday
# Wednesday
# Thursday
# Friday
# Saturday
# Sunday
# ''')

原文地址:https://www.cnblogs.com/OutOfControl/p/9646821.html