Answer to Question #234488 in Python for vijay

Question #234488

You are given a string. Repeat the same string N times separated by space.


Explanation

In the given example the string is messages, N = 3. So we have to repeat the string three times. Then we get messages messages messages as output.


Sample Input 1

message

3

Sample Output 1

message message message

Sample Input 2

pop

4

Sample Output 2

pop pop pop pop


1
Expert's answer
2021-09-07T23:22:00-0400
msg=input("String: ")
N = int(input("Times: "))
out=(msg+" ")*N
print(out)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS