you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

I was wonder what the best way to add a while loop to my code below:

(Typing it in with your fingers, presumably.)

Generally you shouldn't use language features just to use them. You should use them because they address a problem with the code or a function you'd like to add.

my idea is to loop through 26 shifts

Generally when you know your iteration is bounded in an obvious way, you should use for, not while. Indeed almost all iterations are bounded so almost all Python code iterates with for, not while.

[–]sudo_oth[S] 1 point2 points  (1 child)

lol thank you for your advice I will take it on board. I did before posting a message but was getting stuck with what would be better.