-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPython1_Ex3.txt
40 lines (35 loc) · 1.22 KB
/
Python1_Ex3.txt
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
28
29
30
31
32
33
34
35
36
37
38
39
40
Skills: Using prettytable function - printing lists and Dictionary items
Given:
report_name = "Catalyst Center managed devices"
column_titles = ["Name", "Platform", "Management IP", "SW/FW version"]
network_devices = [
{
"hostname": "rtr1", "family":"Routers",
"platform": "C8200L-1N-4T",
"mgmt_ip": "10.10.20.174",
"version": "17.9.20220318:182713"
},
{
"hostname": "sw1",
"family":"Switches and Hubs",
"platform": "C9KV-UADP-8P",
"mgmt_ip": "10.10.20.175",
"version": "17.9.20220318:182713"
},
{
"hostname": "sw2",
"family":"Switches and Hubs",
"platform": "C9KV-UADP-8P",
"mgmt_ip": "10.10.20.176",
"version": "17.9.20220318:182713"
}
]
Write a python script to print output as below using loops:
*** MY REPORT: Catalyst Center managed devices ***
+------+--------------+---------------+----------------------+
| Name | Platform | Management IP | SW/FW version |
+------+--------------+---------------+----------------------+
| rtr1 | C8200L-1N-4T | 10.10.20.174 | 17.9.20220318:182713 |
| sw1 | C9KV-UADP-8P | 10.10.20.175 | 17.9.20220318:182713 |
| sw2 | C9KV-UADP-8P | 10.10.20.176 | 17.9.20220318:182713 |
+------+--------------+---------------+----------------------+