Last active
July 11, 2020 00:56
-
-
Save Yougigun/3ad20425d5d599496773cd293fa90cc6 to your computer and use it in GitHub Desktop.
create dictionary
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
# Create Dictionary | |
## 1. dict(key=value,...) | |
family_age_a = dict(Dad=55, Mom=54, Bro=23) | |
## 2. {key:value,...} | |
family_age_b = {'Dad': 55, 'Mom': 54, 'Bro': 23} | |
## 3. dict([(key,value),...]) | |
family_age_c= dict([('Dad', 55), ('Mom', 54), ('Bro', 23)]) | |
## 4. dict({key:value,...}) | |
family_age_d = dict({'Dad': 55, 'Mom': 54, 'Bro': 23}) | |
family_age_a == family_age_b == family_age_c == family_age_d | |
#output :Ture |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment