Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 518 Bytes

String_repeat.md

File metadata and controls

39 lines (22 loc) · 518 Bytes

CodeWars Python Solutions


String repeat

Write a function called repeatString which repeats the given String src exactly count times.

repeatStr(6, "I") // "IIIIII"
repeatStr(5, "Hello") // "HelloHelloHelloHelloHello"

Given Code

def repeat_str(repeat, string):
    # your code here

Solution

def repeat_str(repeat, string):
    return string * repeat

See on CodeWars.com