# strings.py # Neal Nelson # string examples def encode_old(instring): for ch in instring: print ord(ch), print def encode(instring): message = [] for ch in instring: message = message + [ord(ch)] # print ord(ch), # print message return message def main(): name = raw_input("Give me a name: ") mystr = "" for ch in name: mystr = ch + mystr print mystr length = 0 for ch in name: length = length + 1 print "the length is: ", length print "well, the length is also: ", len(name) print encode("encode this!") main()