问题描述
解决办法
把r强制转换为整数,print(3.14*int(r)*int(r))
原理解释
input语句默认输入格式为字符串,字符串当然不能运算了...用int()强制转换一下就可以了。
Python报错can't multiply sequence by non-int of type 'float'
原文:https://www.cnblogs.com/strawberryfudge/p/14815157.html