This is what ive done so far but this keeps popping up:
Traceback (most recent call last):
File "C:/Users/tom/Documents/python 2.py", line 20, in <module>
print (cypherText)
NameError: name 'cypherText' is not defined
My code:
message = input("what is your message? ").lower()
Shift = int(input("What is your shift? "))
def caesar(message, shift):
cypherText= " "
for ch in message:
if ch.isAlpha():
stayInAlpha = ord(ch) + shift
if stayInAlphabet > ord ('z'):
stayInAlphabet -= 27
if stayInAlphabet < ord ('a'):
stayInAlphabet += 27
finalletter = chr(stayInAlphabet)
cypherText += finalletter
print ("Your message is:")
print (cypherText)
It is at this last bit where I think it all goes wrong but i have no idea why