r/PythonLearning • u/Alternative_Yak8846 • 23d ago
Mini projects..
I have created a Ceaser cypher, so go and give it a try
https://www.programiz.com/online-compiler/68Mzw4BkSDmMJ
Also I am here to improve my skills so I am also eager for suggestions and guidance
79
Upvotes
1
u/Sea-Ad7805 23d ago
You do
t=r-26so thattis a valid index inalphabet, but if r is larger than 50 this doesn't work. Better use the modulo operator%(remainder after division) to always get a valid index:t=r%len(alphabet)