Computer Science, asked by alpha01234, 3 months ago

Write a program to in python to print your name five times ​

Answers

Answered by bagtanarmy123
41

Explanation:

for i in range(5):

print("your name")

Answered by anindyaadhikari13
21

Required Answer:-

Question:

  • Write a program in Python to print your name 5 times.

Solution:

Here comes the program.

1. Using loop.

for i in range(5):

print("My name is abcd.")

2. Without using loop.

print("My name is abcd.\n"*5)

When strings are multiplied with any number (n) , the new string formed becomes the original string repeated n times.

See the attachment for output ☑.

Attachments:
Similar questions