Created
January 28, 2010 16:39
-
-
Save roccogalluzzo/288901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db = ['pri','secondo','terzo','quarto','quinto','sesto'] | |
for string in db: | |
string_ascii= '' | |
s_len = len(string) | |
if (s_len > 5): string = string[:5] | |
for char in string: string_ascii+= str(ord(char)) | |
if (s_len < 5): string_ascii+='0'*(5 - s_len) | |
print string_ascii |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment