Multiply string

To repeat a texts multiple times, as a developer, I need to use *


Introduction

A string can be repeated X number of times, by multiplying it with a X.

Example:

print( "hello " * 3 )

or with variables:

a = "hello "
print( a*3 )

and the output will be:

hello hello hello

Just remember to write add a space to "helloโ€ธ", otherwise the addition would give "hellohellohello"


Instructions

-

Python code



Terminal output


Written by: Bartek / Bartlomiej Rohard Warszawski

?>