-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_dicts.py
More file actions
53 lines (33 loc) · 847 Bytes
/
07_dicts.py
File metadata and controls
53 lines (33 loc) · 847 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Dictionaries
my_dict = dict()
my_other_dict = {}
print(type(my_dict))
print(type(my_other_dict))
my_other_dict = {'Firsname':'Sergio', 'Lastname':'Lattke', 'Age':23}
print(my_other_dict)
print(type(my_other_dict))
my_dict = {
'Firsname':'Sergio',
'Lastname':'Lattke',
'Age':23,
'Lenguaje': {'Python', 'Nodejs', 'Javascript', 'Markdown'},
1:1.70
}
print(my_dict)
my_dict['Firsname'] = 'Daniel'
print(my_dict['Firsname'])
my_dict['Street'] = 'Nelso ct'
print(my_dict)
del my_dict['Street']
print(my_dict)
print('Daniel' in my_dict)
print('Firsname' in my_dict)
print(my_dict.items())
print(my_dict.keys())
print(my_dict.values())
my_new_dict = dict.fromkeys(my_dict)
my_new_value = my_new_dict.values()
print(type(my_new_value))
print(list(my_new_dict))
print(tuple(my_new_dict))
print(set(my_new_dict))