File tree 1 file changed +20
-20
lines changed
1 file changed +20
-20
lines changed Original file line number Diff line number Diff line change 1
- configs = {
1
+ config = {
2
2
"color" : "green" ,
3
3
"width" : 42 ,
4
4
"height" : 100 ,
5
5
"font" : "Courier" ,
6
6
}
7
7
8
8
# Access a value through its key
9
- print (configs ["color" ])
9
+ print (config ["color" ])
10
10
11
11
# Update a value
12
- configs ["font" ] = "Helvetica"
13
- print (configs )
12
+ config ["font" ] = "Helvetica"
13
+ print (config )
14
14
15
- configs = {
15
+ config = {
16
16
"color" : "green" ,
17
17
"width" : 42 ,
18
18
"height" : 100 ,
19
19
"font" : "Courier" ,
20
20
}
21
- user_configs = {
21
+ user_config = {
22
22
"path" : "/home" ,
23
23
"color" : "red" ,
24
24
"font" : "Arial" ,
25
25
"position" : (200 , 100 ),
26
26
}
27
- configs .update (user_configs )
28
- print (configs )
29
- configs .update ([("width" , 200 ), ("api_key" , 1234 )])
30
- print (configs )
31
- configs .update (color = "yellow" , script = "__main__.py" )
32
- print (configs )
27
+ config .update (user_config )
28
+ print (config )
29
+ config .update ([("width" , 200 ), ("api_key" , 1234 )])
30
+ print (config )
31
+ config .update (color = "yellow" , script = "__main__.py" )
32
+ print (config )
33
33
34
- default_configs = {
34
+ default_config = {
35
35
"color" : "green" ,
36
36
"width" : 42 ,
37
37
"height" : 100 ,
38
38
"font" : "Courier" ,
39
39
}
40
- user_configs = {
40
+ user_config = {
41
41
"path" : "/home" ,
42
42
"color" : "red" ,
43
43
"font" : "Arial" ,
44
44
"position" : (200 , 100 ),
45
45
}
46
- configs = default_configs | user_configs
47
- print (configs )
46
+ config = default_config | user_config
47
+ print (config )
48
48
49
- configs = {
49
+ config = {
50
50
"color" : "green" ,
51
51
"width" : 42 ,
52
52
"height" : 100 ,
53
53
"font" : "Courier" ,
54
54
}
55
- user_configs = {
55
+ user_config = {
56
56
"path" : "/home" ,
57
57
"color" : "red" ,
58
58
"font" : "Arial" ,
59
59
"position" : (200 , 100 ),
60
60
}
61
- configs |= user_configs
62
- print (configs )
61
+ config |= user_config
62
+ print (config )
You can’t perform that action at this time.
0 commit comments