【发布时间】:2021-06-23 15:56:53
【问题描述】:
假设我想给变量“e”中的所有数字加 11。我该怎么做?
ans = input("Enter here string of numbers here")
add = input("How much do you want to add each individual numbers by: ") #here is when it will minus each individual number print(output)
e = "21,45,42,71"
所以现在应该说(在添加 11 并打印之后)
32,56,53,82
代码:
ans = input("Enter string of numbers here")
add = input("How much do you want to add each individual numbers by: ")
#here is when it will minus each individual number
print(output)```
【问题讨论】:
-
我们很高兴您和我们在一起,我们需要查看您的代码,以便我们帮助您修复它。
-
您使用字符串存储数字有什么原因吗?为什么不直接列出?
-
我没有使用列表,因为它是用来输入的
标签: python python-3.x string numbers