I want to advance this code by being able to type in a whole sentence. For this I somehow must detect how many signs the user has typed in. How would that be possible? And what loops would you recommend?

You want to use a string for your sentence, from which you can extract individual characters to do your encryption on. In fact, clear_text is already a string, but (presumably) since you only entered a single character, it is only 1 character long.

To get the length of a string, you can use len(clear_text). You can also iterate over the characters of a string using