Print function


#1

Hi Experts,

can you help my to understand why :
print ["O"] * 5

gives
['O', 'O', 'O', 'O', 'O']

instead of:
["O"]["O"]["O"]["O"]["O"]



#2

Because the result needs to be one value, what you expect is five values, won't work.

If you double a list, then does it not make more sense to add all the elements again, rather than to clone it? In particular if you consider the elements to be the list


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.