python 流程控制(if..else..)
if else流程判断
if .. else .. 流程图
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
age_of_me = 25
guess_age = int(input("guess age:"))
if guess_age == age_of_me:
print("Bingo, You got it!!!")
elif guess_age > age_of_me:
print("You may think smaller...")
else:
print("You may think bigger...")
执行结果:
guess age:20
You may think bigger...
guess age:30
You may think smaller...
guess age:25
Bingo, You got it!!!