Skip to content

Instantly share code, notes, and snippets.

@drldcsta
Created November 25, 2015 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drldcsta/02d1b906e0a719e3d0e8 to your computer and use it in GitHub Desktop.
Save drldcsta/02d1b906e0a719e3d0e8 to your computer and use it in GitHub Desktop.
motivational_nonsense.py
>>> d = {}
>>> chars
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
>>> nums
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
>>> tups = zip(chars,nums)
>>> for i in tups:
... d[i[0]] = i[1]
...
>>> s = 0
>>> for i in "knowledge":
... s+=d[i]
... else:
... print s
... s = 0
...
96
>>> s = 0
>>> for i in "hardwork":
... s+=d[i]
... else:
... print s
... s = 0
...
98
>>> for i in "attitude":
... s+=d[i]
... else:
... print s
... s = 0
...
100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment