Q: Cesar encryption I'm trying to write a function that, given an original message and an offset, computes and returns the encrypted message:
def cesar_encryption (message, offset = 1):
 encrypted_message = ""

 for i in range(len(message)):
   char = message[i]
   if (char.islower()):
      encrypted_message += chr((ord(char) + offset)
 return encrypted_message

print (cesar_encryption("I LOVE NATURE", 1))

I have a problem in my code. Please. How could I solve it?

A: def cesar_encryption (message, offset = 1):
    encrypted_message = ""

    for char in message:
        encrypted_message += chr(ord(char) + offset)
    return encrypted_message

print (cesar_encryption("I LOVE NATURE", 1)) # J!MPWF!OBUVSF

Just remove .islower(), because you don't need it.
More about this can be learned at - https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/
