0

Basic Concepts, string operations lesson

"Strings can't be multiplied by other strings. Strings also can't be multiplied by floats, even if the floats are whole numbers." Was what the lesson said. However, earlier in the lesson, they also said that print("spam"*3) works in python 3 why does this work if like print("spam"*3.0) doesn't work?

23rd Aug 2020, 3:36 PM
Sahiba Kaur
Sahiba Kaur - avatar
1 Respuesta
+ 3
Alright now youre gunna need to use some common sense. if i have an apple and multiply that by three, i have 3 apples. letts say i have 3 of something random. i cant multiply that by apple. apple is a fruit not something you can add or subtract
23rd Aug 2020, 3:40 PM
Slick
Slick - avatar