Jared White wrote:
I am trying to produce A Caesar cipher is a simple substitution cipher , that would code For example, if the key value is 2, the word “Sourpuss” would be encoded as “Uqwtrwuu

Here is my code: ( but i keep getting a ERROR)
1 - I see no indentation. Please fix that and repost.
2 - Also post the traceback that is reporting the error. We are not psychic!
3 - be sure to reply to the list.

It works for me Last week but for some reason it isnt work for me right now. ANY REASON WHY PLEASE HELP :(

# alphabet.py
# Simple string processing program to generate an encryp text


def main():
print "This program will encode your messages using a Caesar Cipher"
print
key = input("Enter the key: ")
message = raw_input("Enter the message: ")
codedMessage = ""
for ch in message:
codedMessage = codedMessage + chr(ord(ch) + key)
print "The coded message is:", codedMessage


main()
------------------------------------------------------------------------

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor


--
Bob Gailer
Chapel Hill NC
919-636-4239
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to