题解 | #网页的生成#
网页的生成
https://www.nowcoder.com/practice/eafb4afa3d504fcaadf313bdd4b90148
思路
- 一行输入多个数值,空格分隔,所以用input + split 方法接收;
- 因为考虑不止两个输入值,所以将结果存入列表中;
- 遍历列表,并将字符串转化成浮点型数字,再翻倍打印输出。
import sys
def doubleHeight():
list_height = list(input().split(" "))
for i in list_height:
print(float(i)*2)
doubleHeight()
#我的实习求职记录#
查看3道真题和解析