Master Python Dictionaries Before Your Next DevOps Interview
As a DevOps engineer, today I want to explain the second type of data structure in Python: Dictionary — in a very simple way, from my perspective, Raees Yaqoob Qazi . Understanding Dictionary in Python (Easy Explanation) What is a Dictionary? The first question that comes to mind is: What is a Dictionary? Let’s understand it with a real-life example. In the past, we used the Oxford dictionary to find the meaning of a word. When we search for a word, we get its meaning. In Python, a dictionary works the same way . The word is called a key The meaning is called a value Together, they form a key–value pair Basic Example First, create a file named: dict_ex. py Now write this code: dict_of_items = { "env" : "dev" , "server" : "aws linux2" , "ram" : 8096 , "cpu" : 4 , "active" : True } print(dict_of_items.get("env")) Explanation In this dictionary: "env" is the key "...