teambook

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

## 输入name
##name = input('What is your name ')
name = 'stan'

## test for if,elif
if name == 'stan':
print('1. yes , your are stan' )
print('here is if')
elif name == 'vanees':
print('2. not stan, you are vanees' )
print('here is elif')
else:
print('9. other people , your name is', name )
print('here is else')

##注意数字转型
tnum = input ('compare with 5 ,number is ')
##此时t_num为string,需要转型为int
tnums = int(tnum)

if tnums<5:
print('tnum<5, it is',tnums)
else:
print('tnum>=5, it is',tnums)

posted on 2017-09-13 18:00  teambook  阅读(127)  评论(0编辑  收藏  举报