programming-examples/python/String/Python function to get a string made of 4 copies of the last two characters of a specified string (length must be at least 2).py

6 lines
143 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
def insert_end(str):
sub_str = str[-2:]
return sub_str * 4
print(insert_end('Python'))
print(insert_end('Exercises'))