Q. Write a program to repeat the string ‘‘GOOD MORNING” n times. Here n is an integer entered by the user.
You can understand by Watching video :-
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
>>>
GOOD MORNING
GOOD MORNING
GOOD MORNING
GOOD MORNING
GOOD MORNING
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )