在
Python 2.7中:
a=80 b=100 def status(hp,maxhp): print "You are at %r percent health." % hP*100/maxhp status(a,b)
返回:
TypeError: unsupported operand type(s) for /: ‘str’ and ‘int’
我已经尝试在每个变量和每个变量组合周围放置int().