123k views
3 votes
Given a string, return a new string made of 3 copies of the last 2 chars of the original string. The string length will be at least 2. extra_end('Hello') → 'lololo' extra_end('ab') → 'ababab' extra_end('Hi') → 'HiHiHi'

User Zahmati
by
3.2k points

1 Answer

7 votes

Answer:

def extra_end(str):

return 3*(str[-2:])

Step-by-step explanation:

User Vishnu Shekhawat
by
3.6k points