exercise 12 提示
来源:互联网 发布:hyper v配置nat网络 编辑:程序博客网 时间:2024/06/14 09:00
age = raw_input("How old are you? ")
height = raw_input("How tall are you? ")
weight = raw_input("How much do you weigh? ")
print "So, you're %r old, %r tall and %r heavy." % (
age, height, weight)
age, height, weight)
$ python ex12.py
How old are you? 38
How tall are you? 6'2"
How much do you weigh? 180lbs
So, you're '38' old, '6\'2"' tall and '180lbs' heavy. # 使用%r 会有引号
pydoc ????
ex12
1.print xxxxxxx ,
后面加 逗号 表示下一行的内容与print显示在同一行
我们在每行后加了逗号,这样就不会换行等待输入
1.print xxxxxxx ,
后面加 逗号 表示下一行的内容与print显示在同一行
我们在每行后加了逗号,这样就不会换行等待输入
2.
version1
How tall are you?
6'2
So, you're '22' old, "6'2" tall and '110' heavy.
version1
How tall are you?
6'2
So, you're '22' old, "6'2" tall and '110' heavy.
version2
How tall are you?
6'2"
So, you're '22' old, '6\'2"' tall and '110' heavy.
How tall are you?
6'2"
So, you're '22' old, '6\'2"' tall and '110' heavy.
3.
age = raw_input("How old are you?")
等价于
print "How old are you?",
age = raw_input()
age = raw_input("How old are you?")
等价于
print "How old are you?",
age = raw_input()
4.
x = int(raw_input())
将输入的字符串转换成int型变量 就可以用作数学计算了
x = int(raw_input())
将输入的字符串转换成int型变量 就可以用作数学计算了
5. pydoc don't understand!!!!
0 0
- Exercise 12:提示用户
- exercise 12 提示
- Exercise 14: 提示和传参
- Python Exercise #12
- Exercise(12):纸牌均分
- Exercise
- exercise
- Exercise
- exercise
- 第一章 Introduction exercise 1-12
- K&R C Exercise 1-12 Solution
- 第八章:Graphical Models exercise 1-12
- 第十三章:Sequental data exercise 12-21
- LeetCode Exercise 12:Minimum Size Subarray Sum
- Exercise 4.2 Exercise 4.3
- 第12章:Continuous Latent Variables exercise 1-12
- <<Oracle Applications DBA 基础(第二期)>>Week 12 exercise
- C - The C Answer (2nd Edition) - Exercise 1-12
- exercise11
- -webkit-overflow-scrolling: touch
- mysql 解决中文插入问题
- 6. ZigZag Conversion
- android:Retrofit+LoganSquare的简单用法
- exercise 12 提示
- text-size-adjust
- exercsie13 参数 解包 变量
- 2017年开始的旅程
- 349. Intersection of Two Arrays
- CentOS6重启后DNS被还原的解决办法
- 多线程(多线程面试题)
- LeetCode 150. Evaluate Reverse Polish Notation
- Android 应用资源(二) drawable state