repeat_end¶
Requirements:
substrings and slicing
loop with a counter variable
string building and filtering
Get from user input a string and integer we will call n
. Output a string made of n
repetitions of the last n
characters of the string. You may assume that n
is between 0
and the length of the string, inclusive.
This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.