标签:tar print mil hello wrong 控制语句 out UI utf-8
只有 if 语句的条件为 False 时,else 子句才会执行。
2.elif语句
#!/usr/bin/env python
#_*_ coding:utf-8 _*_
print(‘Please inpuyt your name:‘)
my_name = input()
if my_name == ‘dingkai‘:
print(‘hello ‘ + my_name)
elif my_name == ‘lianghui‘:
print(‘hello ‘ + my_name)
else:
print(‘your name is wrong!‘)
标签:tar print mil hello wrong 控制语句 out UI utf-8
原文地址:http://www.cnblogs.com/dingkailinux/p/7955432.html