Newbie Question: Can't multiply sequence by non-int of type 'str'

Paulo Repreza pxrepreza at gmail.com
Sat Jan 31 19:19:49 EST 2009


Hi,

I'm just learning the very basics of python and I ran into this problem in
version 3.0/3000:

>>>x = input("x: ")
x: 36
>>> y = input("y: ")
y: 42
>>> print (x*y)
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    print (x*y)
TypeError: can't multiply sequence by non-int of type 'str'

But when I run the same code with Python 2.6.1 it does prints the result.

Is there any special function that I should add in order to work properly
under Python 3.0?

Thanks,

Paulo Repreza
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090131/77dd4aa7/attachment.html>


More information about the Python-list mailing list