The learning process has been smooth so far. However I’ve stumbled on one of the lessons with Strings
Part 3 of this exercise ask to use for loop in order to shift all of the letters by one to the right. Somehow I’ve completed the step 3 while doing step 2 with my own solution - I’ve used slicing, with the following code:
password = username[-1] + username[:-1]
This code seem to do exactly the same as required in the excercise. It would even work with different username lengths as well as pattern shifts (-2, -3, etc.). I then did the for loop part as well. But I’m now wondering what kind of benefit does for loop has compared to slicing or vice versa for strings like in such exercise?