Created
November 25, 2015 20:09
-
-
Save drldcsta/02d1b906e0a719e3d0e8 to your computer and use it in GitHub Desktop.
motivational_nonsense.py
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
>>> 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