Write a program to repeat the string "GOOD MORNING" n times Here n is an integer entered by the user

Опубликовано: 18 Октябрь 2024
на канале: Portal Express
741
17

Q. Write a program to repeat the string ‘‘GOOD MORNING” n times. Here n is an integer entered by the user.

Website Link :-

https://www.pathwalla.com/2021/05/wri...

Answer:-

n = int(input("How many times do you want:- "))
print ("GOOD MORNING\n" * n)

Output :-

How many times do you want:- 5
GOOD MORNING
GOOD MORNING
GOOD MORNING
GOOD MORNING
GOOD MORNING