发布时间:2017-11-09 13:15:22编辑:Run阅读(5459)
现在要做的是把数据读到你的程序里去,不理解?不要紧,跟着做几个练习就会明白
一般软件做的事情主要就是下面几条:
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:提示别人
51534
51087
41636
38382
32879
29842
28574
23518
23458
21801
1946°
2650°
2206°
2139°
2578°
2171°
2890°
4797°
4632°
3297°