PYTHON : DICTIONARIES

#CODE:EXAMPLE-1
  1. #!/usr/bin/python

  2. target_client = {"mac": "00:11:22:33:44:55", "ip": "10.0.2.1", "os": "window"}

  3. print(target_client)
  4. print(target_client["mac"])
  5. print(target_client["ip"])
  6. print(target_client["os"])
#CODE:EXAMPLE-1
  1. #!/usr/bin/python

  2. senpai = {"name": "ras senpai", "age": "19"}

  3. print(senpai)
  4. print(senpai["age"])
  5. print(senpai["name"])

  6. senpai["age"] = 18 #to change the entry/key!
  7. print(senpai["age"])
#RESULT:
C:\python\python.exe C:/Users/gaura/PycharmP {'name': 'ras senpai', 'age': '19'} 19 ras senpai 18 Process finished with exit code 0
Python - DICTIONARIES/IN FULL DETAILS

Post a Comment

If you have any doubts, please let me know

Previous Post Next Post