Last active
April 18, 2016 20:55
-
-
Save Echocage/2318ca6622254a2af23c2806b4fe960f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class example(object): | |
| stuff = "nothing" | |
| def test(): | |
| return "Blah blah" | |
| library = {1: "toy", | |
| 2: "box", | |
| 3: "name", | |
| 4: example(), | |
| 5: example().stuff, | |
| 6: test()} | |
| for num, string in library.items(): | |
| print(num, string) | |
| print("\n\nYou can also do it like this...\n") | |
| new_library = ["dog", "cat", "home", example().stuff] | |
| for num, string in enumerate(new_library): | |
| print(num, string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment