# python 2.x 中可以写成print xxx可以带括号, 也可以不带
# python 3.x 中必须写成print(xxx)必须带括号
print xxx
注意看版本号2.7.6
3.4.3
Python 2.7.9 (default, Mar 8 2015, 00:52:26)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x=input("x: ")
x: 42
>>> y=input("y: ")
y: 34
>>> print x * y
1428
>>>
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> x = input (":")
:42
>>> y=input(":")
:34
>>> print (x*y)
Traceback (most recent call last):
File "", line 1, in
TypeError: can't multiply sequence by non-int of type 'str'
>>> print(int(x) * int(y))
1428
>>>
你既然是键盘输入给X,Y赋值,就不要在里面给他个数字啊,你这等于”x=x:34“和”y=y:42“
你算乘法怎么也算出不来啊
x:34*y:42=?