-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjects.py
More file actions
27 lines (24 loc) · 796 Bytes
/
Copy pathObjects.py
File metadata and controls
27 lines (24 loc) · 796 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
""" _______________________________ """
#!""" Dictionaries (OBJECTS) """
""" OBJECT use {
object_name={
"KEY":"VAlUE"
}
KEY type number or string
Value type number or string or boolean or array or object
} """
convert_month = {
"Jan":"January",
"Feb":"February",
"Mar":"March",
"Apr":"April",
"May":"May",
"Jun":"June",
}
print(convert_month["Mar"]) #* The output is March
print(convert_month.get("Jun")) #* The output is June
print(convert_month.get("Hope")) #* The output is None
""" print(object_name.get(KEY_value,ERROR_MSG)) """
print(convert_month.get("Hope","The value doesn't exist")) #* The output is The value doesn't exist
print(convert_month.get("Jan","The value doesn't exist")) #* The output is January
""" _______________________________ """