TypeError: can't multiply sequence to non-int

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jul 9 10:32:18 EDT 2007


En Mon, 09 Jul 2007 10:12:42 -0300, Snezhana <snezhana.manoah at stilog.com>  
escribió:

???

Did you intend to post any question?
The error is rather explicit: you can't say:
"abc" * 5.2241
[1,2,3] * "Hello"
(4,"z") * None

The right operand must be an integer:
"abc" * 5 (gives "abcabcabcabcabc")
[1,2,3] * 8 (gives a list with 24 numbers)
(4,"z") * 2 (gives (4,"z",4,"z"))

-- 
Gabriel Genellina




More information about the Python-list mailing list