Repeat User Input

Beginner

Repeat User Input Challenge

In this fun and simple challenge, your task is to create a function, repeat_user_input, that takes two parameters:

  1. A string user_input - which represents what the user has entered.
  2. An integer n - which tells how many times the user_input should be repeated.

Your function should return the string user_input repeated n times, concatenated together.

Examples:

repeat_user_input("Hello", 3) # returns "HelloHelloHello" repeat_user_input("Fun", 2) # returns "FunFun" repeat_user_input("Python", 1) # returns "Python" repeat_user_input("Go", 0) # returns ""

Try to think about what happens when n is zero or more than one! This exercise will help you practice string manipulation and loop structures in Python. Enjoy coding!

Geek
Inputs

Arg 1:

"Hello"

Arg 2:

3
Expected Output
"HelloHelloHello"
Actual Output
Repeat User Input [beginner] | Coding for Kids