The for loop in stars function could look like this:
I have changed the names of the variables so now if you look at it, you know what is going on. Single letter var names don't speak too much for themselves.
You don't need the index to get each value of an iterable.
Do you care if each letter is lower or uppercase? If you do, then you need all letters. Then you need two lists.
The programming is not as complicated as the most people think it is. It could and it is. Very. But when it comes to what you are studying right now, all it's needed is to imagine, how would you do it by hand. And implement it in a code.
So you take a letter of the word and you get the index of that letter in the list and move it to the right - add 1 to the index. Check if the letter is the last one and take the first one if that is the case. Otherwise, you get an error: List index out of range.
I have changed the names of the variables so now if you look at it, you know what is going on. Single letter var names don't speak too much for themselves.
You don't need the index to get each value of an iterable.
def stars(word): for char in word : # on every iteration char holds the next letter of the word print("*", char, sep='', end='') print("*")The "encryption"...
Do you care if each letter is lower or uppercase? If you do, then you need all letters. Then you need two lists.
The programming is not as complicated as the most people think it is. It could and it is. Very. But when it comes to what you are studying right now, all it's needed is to imagine, how would you do it by hand. And implement it in a code.
So you take a letter of the word and you get the index of that letter in the list and move it to the right - add 1 to the index. Check if the letter is the last one and take the first one if that is the case. Otherwise, you get an error: List index out of range.