ex12

 1 # -*-coding:utf-8 -*-
 2 print ("how old are you?"),# python 3.0版本开始已经去掉了raw_input函数,直接用input函数就可以了
 3 age = input("old?")   
 4 print ("how tall are you?"),
 5 height = int(float(input()))   #假如输入的是小数点需要加入float()函数就可以了
 6 print ("how much do you weigh?"),
 7 weight = int(input())  #如果不加入float()函数就需要输入整数
 8 
 9 print ("so, you're %r old, %r tall and  %r heavy." % (
10 age, height, weight))
11 
12 
13 #熟悉python -m pydoc input / open / file / os /sys 的用法
14 # 比如说: python -m pydoc math    
15 #-m参数:Python以脚本的方法运行模块

 

posted @ 2016-11-16 20:09  听风呤  阅读(141)  评论(0编辑  收藏  举报