一个关于Python乘法的问题,为什么老是出错,要怎么才可以正确
>>>a=input("a:")a:30>>>b=input("b:")b:20>>>printa*bSyntaxError:Missingparenthesesinca...
>>> a=input("a:")a:30>>> b=input("b:")b:20>>> print a*bSyntaxError: Missing parentheses in call to 'print'>>> print (a*b)Traceback (most recent call last): File "<pyshell#7>", line 1, in <module> print (a*b)TypeError: can't multiply sequence by non-int of type 'str'>>> print ("a*b")a*b>>>
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询