-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplex_dict.py
More file actions
64 lines (50 loc) 路 1 KB
/
Copy pathcomplex_dict.py
File metadata and controls
64 lines (50 loc) 路 1 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
key: lists, boolean, dict
"""
complex_dict = {
'hello': 100,
100: 'world',
3.14: 'pi',
'pi': 3.14,
'e': 2.71828,
'hi': print('--hello--'),
'hey': print,
10: [1, 10.5, False, [2, 3], range(10), {
range(2): range(5, 10, 2)
}],
67.45: False
}
print(complex_dict[10][5])
complex_dict[10][-1]['hello'] = [1, 2, 3, 4]
complex_dict[10][-1]['hello'].append(45)
for item in complex_dict[10][-1]['hello']: # [1, 2, 3, 4]
print(item)
# for item in range(5, 10, 2):
# print(item)
# for key, value in complex_dict.items():
# print(type(key), type(value))
# a = print
# b = a
# complex_dict['hey']('hello world', end=' *** \n\n')
# print('hello world')
# a('hello world')
# b('hello world')
# var = print(print('hello'))
# print(var)
# f(g(x))
"""
output
var = print(print('hello'))
--- print()
--- print('hello')
-------- print
-------- 'hello' ==>
-------- return None
--- print(None) ==>> None
var = None
print(var)
print(None) ==> None
hello
None
None
"""