Question: Task 1: Apply the concepts learned about dictionaries on a real-life problem a. Create a database in the following format Values Keys Router1 (name) zframez
Task 1: Apply the concepts learned about dictionaries on a real-life problem a. Create a database in the following format Values Keys Router1 (name) zframez (username) zframez (pwd) (IP) 1. Write a python program to print the value of a given key 2. Write a python program to check whether the given key is present, if present print the value , else add a new key and value 3. Write a python program which print the dictionary Sample Program: d ('A':1, 3:2,"C":3} key raw input ("Enter key to check: ") if key in d. keys(): print("key is present and value of the key is:") print (d[key]) else: print("Key isn't present!") b. Create a database in the following format Sample Program my_dict = {"C1":[1,2,3], "c2":[5,6,7), 'C3":[9,10,11]} Interface IP status 1.1.1.1 up 2.2.2.2 down Ethernet Etherneti Seriale Seriali 3.3.3.3 up up 4. Write a python program to print the keys 3. Write a python program to print the values
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
