Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
- 'x', 'y' 'z']
- crypted = [] # empty string for output
- word = raw_input('Write below the word or the phrase to code:\n')
- for i in range(0, len(word)): # from 0 to word's max length
- if word[i] in alpha: # if character is in the alphabet
- crypted.append(alpha.index(word[i]) + 1) # adds every position in the output
- else:
- print 'error, not found characters' # some kind of error I don't raise
- print crypted # prints the final string
Advertisement
Add Comment
Please, Sign In to add comment