python - 从输入语句打印提示?
问题描述
我在使用 dcoder 时遇到问题。我的输入是:20 50 8 30 10
它不仅输出80,还输出输入语句的提示。如何让它只打印 80?
maxw = int(input("bag weight: "))
itemOne = input("item value & weight:") #item 1
itemTwo = input("item value & weight:") #item 2
lone, ltwo = itemOne[0:3], itemTwo[0:3] #rid of " "
iione, iitwo = int(lone), int(ltwo) #change to int
def total_value(x, y):
tval = x + y #add together 50 and 80
return tval
result = total_value(iione, iitwo)
print(result)
![enter image description here](https://i.stack.imgur.com/f8Jh4.png)![enter image description here](https://i.stack.imgur.com/zCAcC.png)
解决方案
推荐阅读
- arduino - 从 MPU-9250 获取航向/方向
- jquery - 过滤没有 lambda 符号的 JSON
- typescript - 每60秒获取一次http请求Angular 6
- unity3d - Unity 游戏对象控制器
- google-chrome-devtools - Puppeteer 中的 HeadlessExperimental
- python - 找出在哪个版本的 numpy 上添加了函数
- tabulator - 从文本文件加载表数据
- java - Spring WebFlux | 用于检测未使用的 Mono / Flux 的静态代码分析工具
- python - 如何处理for循环中跳过的项目
- php - 推送到 Heroku 时收到 post-autodump-load 错误