标签:每天一段python
vim if.py //编译以.py结尾的文件 #!/usr/bin/env python //程序内容开始 #File: if.py print ‘Hello, how old are you?‘ age = int(raw_input(‘Please input your age:‘)) //定义age为整数型 if age == 28: print "You‘re at the age of marriage!" elif age > 28 and age <35: print "You must go on a blind date now." elif age < 28: print "You‘re still young and good to learn!" else: print "Sorry, I don‘t know your age!" //程序内容结束 chmod +x if.py //赋予文件可执行权限 ./if.py //执行程序
本文出自 “经验来自痛苦” 博客,谢绝转载!
标签:每天一段python
原文地址:http://strike.blog.51cto.com/10311680/1732451