提问人:mroquinn 提问时间:8/28/2023 最后编辑:Cowmroquinn 更新时间:8/28/2023 访问量:46
我在编码课上收到了这个代码。我做错了什么?[已结束]
I am receiving this code in my coding class. What am i doing wrong? [closed]
问:
Exited with return code 1.
Traceback (most recent call last):
File "main.py", line 5, in <module>
print(int1 * int2 * int3)
TypeError: can't multiply sequence by non-int of type 'str'
尝试输出 3 个用户输入整数的乘积。
答:
2赞
Murad Eliyev
8/28/2023
#1
似乎您正在使用函数获取整数。
请改为执行此操作input()
a1 = int(input())
这会将字符串转换为整数值
评论