Here is how I would approach it:
You can extract parts of any string using the following syntaxstring[ start_index_pos: end_index_pos: step_size]
where string the name of the string variable and step_size is optional.
You can use negative index numbers to determine starting index from the end instead of the front.
So -1 is the last character. I think an example might illustrate this a little more clearly.
would make last_chars equal to "ON"
The next step is to loop n time using a simple for loop and print out last_chars
Let me know if you get stuck I can help further.