【问题标题】:Id like to calculate how many bugs this person collected and it keeps crashing我想计算这个人收集了多少错误并且它一直在崩溃
【发布时间】:2022-06-10 18:32:17
【问题描述】:

我在下面有这段代码,当我尝试在控制台中运行它时,它会立即打开和关闭。即使在最后输入()也是如此...任何帮助将不胜感激...

totalNumDays = 5
totalNumBugs = 0

for currentDay in range(1, totalNumDays + 1):
    numBugCollected = int( input("Bugs collected on day " + currentDay ": "))
    totalNumBugs = totalNumBugs + numBugCollected
pass

print("You have collected a total of", totalNumBugs)

input("press enter")

【问题讨论】:

  • 它还会显示你有语法错误

标签: python


猜你喜欢
  • 2021-12-10
  • 1970-01-01
  • 2017-08-01
  • 1970-01-01
  • 1970-01-01
  • 2021-06-15
  • 1970-01-01
  • 2021-08-19
  • 1970-01-01
相关资源
最近更新 更多