First, fix your call to raw_input
:
message = raw_input("Enter your message: ")
When you called .strip(",")
on your input string, you created a list of strings. So, if you had originally entered "Hello, world", the result would have been ['Hello', ' world']
.
Later in your program you require message
to be a string, not a list.
Next, initialize the variable l
and print its value after the loop:
l=[]
for i in xrange(0,len(message)-1):
l += [ord(message) ^ ord(randomstring) for message,randomstring in zip(message,randomstring)]
print l