-
Notifications
You must be signed in to change notification settings - Fork 1
/
exercise_20.py
34 lines (28 loc) · 870 Bytes
/
exercise_20.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
print(
'-----------------------------------------\n'\
'Practical python education || Exercise-20:\n'\
'-----------------------------------------\n'
)
print(
'Task:\n'\
'-----------------------------------------\n'\
'Write a Python program to get a string which is n (non-negative integer) copies of a given string."\n'
)
print(
'Solution:\n'\
'-----------------------------------------'\
)
def larger_string(str, n):
result = ""
for i in range(n):
result = result + str
return result
user_input = input("Enter string for n-clonning = ")
amount = abs(int(input("Enter amount of clonning for the string = ")))
print("Result")
print(larger_string(user_input, amount))
print(
'\n-----------------------------------------\n'\
'Copyright 2018 Vladimir Pavlov. All Rights Reserved.\n'\
'-----------------------------------------'
)