curriculum/challenges/english/blocks/workshop-caesar-cipher/6819c7beb4a8289c2b4f24d5.md
A negative or null shift should not be accepted by your function. Therefore, after your first if statement, create another if statement that checks if shift is less than 1 and returns the string Shift must be a positive integer.
You should have a second if statement that checks if shift is less than 1.
({ test: () => runPython(`
_cond = _Node(_code).find_function("caesar").find_ifs()[1].find_conditions()[0]
_options = ["shift < 1", "1 > shift", "shift <= 0", "0 => shift"]
assert any(_cond.is_equivalent(option) for option in _options)
`) })
Your second if statement should return Shift must be a positive integer.
({ test: () => assert(runPython(`_Node(_code).find_function("caesar").find_ifs()[1].find_bodies()[0].has_return("'Shift must be a positive integer.'")`)) })
def caesar(text, shift):
if not isinstance(shift, int):
return 'Shift must be an integer value.'
--fcc-editable-region--
--fcc-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)