Two ways to multiply

by ashleyaelder on February 21, 2016

Brackets are used to display a number multiple times together.

print(21*10)
print([21]*10)
print("kitten"*10)

Output:

210
[21, 21, 21, 21, 21, 21, 21, 21, 21, 21]
kittenkittenkittenkittenkittenkittenkittenkittenkittenkitten

{ 0 comments… add one now }

Leave a Comment

Previous post: