Error on a simple code

This is the place for queries that don't fit in any of the other categories.

Error on a simple code

Postby leosava » Tue Oct 29, 2013 1:17 pm

Hello Guys I am new on python I am just messing around to see how it works I am using Python Shel 3.3.2 I would like to know why I am getting this error any idea?



traceback (most recent call last):
File "C:/Python33/eu.py", line 4, in <module>
print ( x * y)
TypeError: can't multiply sequence by non-int of type 'str'

Any help will be appreciated.

All the best.
Last edited by leosava on Tue Oct 29, 2013 1:28 pm, edited 1 time in total.
leosava
 
Posts: 4
Joined: Sun Oct 27, 2013 9:29 am

Re: Error on a simple code

Postby stranac » Tue Oct 29, 2013 1:20 pm

Read this and edit your post.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1212
Joined: Thu Feb 07, 2013 3:42 pm

Re: Error on a simple code

Postby Mekire » Tue Oct 29, 2013 1:37 pm

Please add code tags to your post.

Code: Select all
>>> [1,2,3] * "abc"
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
TypeError: can't multiply sequence by non-int of type 'str'
You are multiplying a sequence by a string; as the exception states. What values are you trying to multiply and what is your expected result?

-Mek
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to General Coding Help

Who is online

Users browsing this forum: Mikhailov and 5 guests