#!/usr/bin/env python
import tab
#for i in range(3):
#while True:
n = 0
while n < 10:
n = n + 1
print n
name = raw_input('what is your name? ').strip()
if len(name) == 0:
continue
break
#usually use while ... do ... in C & C++ ...
else:
print "loop is done!!!"
#loop is complete done,will show this !
age = raw_input('what is your age? ')
sex = raw_input('what is your sex? ').strip()
job = raw_input('what is your job? ')
print type(age)
print "your name is %s, your age is %s, your sex is %s, your job is %s!" % (name ,age ,sex ,job)
print """Personal info:
Name : %s
Age : %d
Sex : %s
Job : %s
""" % (name ,int(age) ,sex, job)
if age <='28':
print "you can have half day's public holiday!"
elif sex == 'F':
print "Let me think about it ..."
else:
print "You are too old to take this holiday!"
python学习之小的练习程序
最新推荐文章于 2023-09-26 15:15:00 发布