Answered step by step
Verified Expert Solution
Question
1 Approved Answer
List: Create a list named device _ ip containing IP addresses as strings. Your network consists of one router and at least one of each
List: Create a list named deviceip containing IP addresses as strings. Your network consists of one router and at least one of each of the following devices: switch, server, workstation, printer, and mobile device. Each device should have a unique IP address. The router's IP address should be
Print each IP address on a new line.
Tuple: Since the MAC addresses of devices are unique and not changing, you decide to store them in a tuple named devicemac. Create this tuple with MAC addresses corresponding to each IP address. A MAC address looks like :::::
Print each MAC address on a new line.
Set: You also want to keep track of the different types of devices in your network. As the device types are distinct and do not have duplicates, create a set named devicetype that contains the types of devices you have in your network. These include 'router', 'switch', 'server', 'workstation', 'printer', and 'mobile device'. Print each device type on a new line.
Print each device type on a new line.
List and Dictionary: Create a list named devicetypes. This list should contain the device type for each device corresponding to the IP address in your deviceip list and the MAC address in your devicemac tuple. Ensure that 'router' is the first device type in this list, and that the list contains at least one of each other device type.
Note: We are creating an additional list named devicetypes to manage the mapping of device types to their corresponding IP and MAC addresses. This ensures that there's only one router and at least one of each other device type in the network.
Now, create a dictionary named networkinventory. The dictionarys keys should be the IP addresses from your deviceip list. Each value in the dictionary will itself be a dictionary with two keys: 'MAC' and 'Type'. The 'MAC' key corresponds to the MAC address from devicemac, and 'Type' corresponds to a device type from your devicetypes list. Ensure that the device with the IP is assigned the 'router' type.
Print each keyvalue pair on a new line.
When your program runs, it should match the expected output below.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started