发布时间:2017-11-09 13:15:22编辑:Run阅读(4729)
现在要做的是把数据读到你的程序里去,不理解?不要紧,跟着做几个练习就会明白
一般软件做的事情主要就是下面几条:
1.接受人的输入
2.改变输入
3.打印出改变的输入
代码如下:切记不要复制粘贴,每一个练习,都需要自己手动去敲代码,这样才能明白
# coding: utf-8 __author__ = 'www.py3study.com' print("How old are you?") age = input() print("How tall are you?") height = input() print("How much do you weight?") weight = input() print("So,you're {} old, {} tall and {} heavy.".format(age, height, weight))
应该看到的结果
How old are you?
18
How tall are you?
180
How much do you weight?
130
So,you're 18 old, 180 tall and 130 heavy.
常见问题
如何读取用户输入的数字进行计算?
可以使用x = int(input()),它会把用户输入的字符串转换为整数
上一篇: 习题10:那是什么?
下一篇: 习题12:提示别人
48179
46914
37830
35120
29651
26311
25246
20275
19925
18397
6044°
6747°
6226°
6206°
7326°
6157°
6276°
6754°
6743°
8108°