"""Write a Python program to get the n (non-negative integer)
copies of the first 2 characters of a given string.
Return the n copies of the whole string if the length is less than 2"""


def substring_copy(str, n):
    flen = 2
    if flen > len(str):
        flen = len(str)
    substr = str[:flen]

    result = ""
    for i in range(n):
        result = result + substr
    return result
str = input("Please provide any string to repeat first two letters: ")
n = int(input("Please provide number of repeats: "))

print(substring_copy(str, n))
42b707453a4b6389b473ea93bf9489528906969b
<mask token>

<mask token>


def substring_copy(str, n):
    flen = 2
    if flen > len(str):
        flen = len(str)
    substr = str[:flen]
    result = ''
    for i in range(n):
        result = result + substr
    return result


<mask token>

<mask token>


def substring_copy(str, n):
    flen = 2
    if flen > len(str):
        flen = len(str)
    substr = str[:flen]
    result = ''
    for i in range(n):
        result = result + substr
    return result


<mask token>
print(substring_copy(str, n))

<mask token>


def substring_copy(str, n):
    flen = 2
    if flen > len(str):
        flen = len(str)
    substr = str[:flen]
    result = ''
    for i in range(n):
        result = result + substr
    return result


str = input('Please provide any string to repeat first two letters: ')
n = int(input('Please provide number of repeats: '))
print(substring_copy(str, n))

"""Write a Python program to get the n (non-negative integer)
copies of the first 2 characters of a given string.
Return the n copies of the whole string if the length is less than 2"""


def substring_copy(str, n):
    flen = 2
    if flen > len(str):
        flen = len(str)
    substr = str[:flen]

    result = ""
    for i in range(n):
        result = result + substr
    return result
str = input("Please provide any string to repeat first two letters: ")
n = int(input("Please provide number of repeats: "))

print(substring_copy(str, n))