我写了一个解题器,代码如下:
import time
while True:
print("欢迎使用三角形数表解题器")
time.sleep(1)
hang = input("请输入行")
lie = input("请输入列")
print((((hang + lie) - 1) * ((hang + lie) - 1)))
可运行了一半后,出现;
欢迎使用三角形数表解题器请输入行12请输入列3Traceback (most recent call last): File "C:\Users\Administrator\Documents\mindplus-py\user\2024-03-31-11-58-03\11111.py", line 10, in <module> print((((hang + lie) - 1) * ((hang + lie) - 1)))TypeError: unsupported operand type(s) for -: 'str' and 'int'
怎么办????????
[求助问答]TypeError: unsupported operand type(s) for -: 'str' and 'int'是什么意思? 中等
Makelog作者原创文章,未经授权禁止转载。
评论

你可能感兴趣的
- 简单
#科学实验探究#水的净化
小含糊online6234 18
- 简单
卷轴式双节祝福语
DeadWalking222 20
- 简单
北斗技术赋能 将学校平面地图制作成纪念品
志学1271 40
- 简单
五一劳动节—远程无人驾驶测试甲醛小车
于恺344 20
- 中等
智能决策与多模态交互的植物养护系统
源启391 17
三春牛-创客2024.04.21
TypeError: unsupported operand type(s) for -: 'str' and 'int' TypeError:不支持的操作数类型-:'str'和'int'
三春牛-创客2024.04.21
数值类型不对
DFEDU2024.04.07
先把变量转成int类型的数据,再去做加减乘除运算。