Build a Caesar Cipher - Step 20

Tell us what’s happening:

Iʻm not sure what to do for step 20. This is my code:

if (shift < 1) and (shift > 25):
return ‘Shift must be an integer between 1 and 25.’

Your code so far

def caesar(text, shift):

    if not isinstance(shift, int):
        return 'Shift must be an integer value.'
    

# User Editable Region

    if (shift < 1) and (shift > 25):
        return 'Shift must be an integer between 1 and 25.'

# User Editable Region


    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    shifted_alphabet = alphabet[shift:] + alphabet[:shift]
    translation_table = str.maketrans(alphabet + alphabet.upper(), shifted_alphabet + shifted_alphabet.upper())
    return text.translate(translation_table)

encrypted_text = caesar('freeCodeCamp', 3)
print(encrypted_text)

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:148.0) Gecko/20100101 Firefox/148.0

Challenge Information:

Build a Caesar Cipher - Step 20

Hi @kidiolan ,

Remember that the logical OR operation in Python is implemented through the or operator.

Is it possible for shift to be less than 1 and greater than 25?

Happy coding!