DEV Community

[Comment from a deleted post]
Collapse
 
meseta profile image
Yuan Gao • Edited

yes Python's semantics for multiplying a string with a number is to repeat the string. It's a feature of Python's strings rather than print(). It does this for lists too. [0]*variable is often a fast way to initialize a list to a length given by a variable

Collapse
 
haytamkh7 profile image
haytam_7

Yes, and these are very helpful features in Python.