Skip to content

Instantly share code, notes, and snippets.

@roccogalluzzo
Created January 28, 2010 16:39
Show Gist options
  • Save roccogalluzzo/288901 to your computer and use it in GitHub Desktop.
Save roccogalluzzo/288901 to your computer and use it in GitHub Desktop.
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