Created
March 31, 2017 11:49
-
-
Save ultrakain/04db18065007b6cfd8af87539d1110a0 to your computer and use it in GitHub Desktop.
python iteration
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
# string | |
x = "Beautiful is better than ugly" | |
for c in x: | |
print(c) | |
# list | |
l = [1, 2, 3, 4, 5, 6, 7] | |
for item in l: | |
print(item) | |
# dict | |
d = {'name': 'yanggun', 'age': 21, 'address': 'busan'} | |
for item in d: | |
print(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment