Important Things Repeated 8 Times, Using Python

Using Python for printing is something everyone is familiar with,

print(“Hello world”)

Output

Hello world

If you want to print 3 times “Hello world”:

Code 1:

print("Hello world")
print("Hello world")
print("Hello world")

Output:

Hello world

Hello world

Hello world

Code 2:

print("Hello world"*3)

Output:

Hello worldHello worldHello world

Code 3:

print("Hello world\n"*3)

Output:

Hello world

Hello world

Hello world

Code 3 is easier to use; for example, if you want to print 8 times, just change 3 to 8.

Important Things Repeated 8 Times, Using Python

Likes, views, and recommendations are better support.

Leave a Comment