python不支持的数据类型int_python – TypeError:不支持的操作数类型:’int’和’str’错误...

我的代码有问题,它说

TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’

而且我不确定为什么.我的代码区域导致了这一点,如下所示,所有帮助将不胜感激:D!*编辑错误似乎是因为输入选项,如果这有任何帮助.

Score1 = str(input("what did the first person get in their test the first time?"))

Score2 = str(input("what did the first person get in their test the second time?"))

Score3 = str(input("what did the first person get in their test the third time?"))

Score4 = str(input("what did the second person get in their test the first time?"))

Score5 = str(input("what did the second person get in their test the second time?"))

Score6 = str(input("what did the second person get in their test the third time?"))

Score7 = str(input("what did the third person get in their test the first time?"))

Score8 = str(input("what did the third person get in their test the second time?"))

Score9 = str(input("what did the third person get in their test the third time?"))

P1S = [Score1, Score2, Score3]

P2S = [Score4, Score5, Score6]

P3S = [Score7, Score8, Score9]

print ("here are the scores of",Name1,",well done") # defines scores

print(P1S)

print ("here is the average score of",Name1,",Well Done") # makes average of scores

print(sum(P1S)/float(len(P1S)))

print ("here are the scores of",Name2,",well done") # defines scores

print(P2S)

print ("here is the average score of",Name2,",Well Done") # makes average of scores

print(sum(P2S)/float(len(P2S)))

print ("here are the scores of",Name3,",well done") # defines scores

print(P3S)

print ("here is the average score of",Name3,",Well Done") # makes average of scores

print(sum(P3S)/float(len(P3S)))

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值