首页 > 其他 > 详细

流程控制

时间:2015-06-13 06:28:29      阅读:132      评论:0      收藏:0      [点我收藏+]
#!/usr/bin/env python
import tab
for i in range(3):

        name = raw_input(‘Plelease input your name: ‘)
        if len(name) == 0:
                continue
                break
        print ‘current loop:‘, i
age = int(raw_input(‘Plelease input your age: ‘))
sex = raw_input(‘Plelease input your sex: ‘).strip()
print """Personal info:
        name: %s
        age:  %d
        sex:  %s
""" %(name,age,sex)

if age <= 28:
        print "you can have hald day‘s "
elif sex == ‘F‘:
        print "let me think about it"
else:
        print "oh ,no"


本文出自 “梁恩宇-9527” 博客,请务必保留此出处http://liangey.blog.51cto.com/9097868/1661421

流程控制

原文:http://liangey.blog.51cto.com/9097868/1661421

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!