Issue
I have the fallowing code to encrypt a massage:
massage= raw_input("Enter message to be encrypted: ")
spec = chr(0b1010101)
key = ord(spec)
encrypt = ""
for i in range(0, len(massage)):
encrypt = encrypt + chr(ord(massage[i]) ^ key)
print encrypt
say I give "yo yo" to it
it will give me :
,
,:
,:u
,:u,
,:u,:
I only need the final answer which is the ,:u,:
what do i have to do?
Solution
Move the print statement outside the for loop. To do that you need to unindent the print statement.
Answered By - Malcolm Post
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.