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
7.5k points

1 Answer

7 votes

Answer:

def extra_end(str):

return 3*(str[-2:])

Step-by-step explanation:

User Vishnu Shekhawat
by
7.8k points

Related questions

asked Sep 13, 2021 163k views
Dfarrelly asked Sep 13, 2021
by Dfarrelly
8.7k points
2 answers
3 votes
163k views
asked Jun 11, 2021 54.0k views
DTRT asked Jun 11, 2021
by DTRT
8.5k points
2 answers
2 votes
54.0k views
1 answer
9 votes
56.4k views