[Tutor] error message questions

Alan Gauld alan.gauld at btinternet.com
Sun May 27 21:08:36 CEST 2007


"adam urbas" <adamurbas at hotmail.com> wrote in

> Hello all,I was wondering if there would be someone who
> would be able to give me a list of error messages and
> their meanings.

The errors are actually self explanatory - no really! - once
you undestandd the basic concepts. But to understand
those you will need to go back to basics.

I suggested in an earlier post that you read my Raw Materials topic
which discusses data and types. Did you do that?

Also the Talking to the User illustrates the use of raw_input,
you could usefully read that too. it discusses using the Python
conversion functions to get the right input values from raw_input..

> It says:can't multiply sequence by non-int of type 'str'

Which means Python cannot multiply the two types of data
you are giving it. You need to convert those values to the compatible
types.

> can't multiply sequence by non-int of type 'float'

Same thing, you have a sequence type on one side
(probably a string but could be a list or tuple?) and a float
on the other. You need to turn the sequence into something
that a float can multiply - either another float or an int (or
a complex or decimal if you feel really picky).

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list