My code:
def Encryption(text):
for I in text:
string = ""
ASCII = ord(text)
Result = ASCII + Offset
if Result > 126:
Result -= 94
else:
Result = Result
ResultASCII = chr(Result)
string += ResultASCII
For my first piece of GCSE coursework, we had to make an encryption program. The final part that we have to make is the part that actually encrypts your message. I've used this code, however it comes up with an error of:
TypeError: ord() expected a character, but string of length # found
How do I get it to detect a string instead of just a character?