Lab 3 of 5
Β·
Semi-Guided
Create CiscoDevice and MerakiDevice Subclasses
Objective: Extend NetworkDevice with two subclasses that each add a vendor-specific attribute.
Instructions
Create a file called lab3.py. Starting from the NetworkDevice class in Lab 2, create two subclasses:
CiscoDevice(NetworkDevice)β addsios_version, overridesget_summary()to appendβ IOS: <version>MerakiDevice(NetworkDevice)β addsmodel, overridesget_summary()to appendβ Model: <model>
Both subclasses should call super().__init__() to set the base attributes.
Your output must match exactly:
sw-core-01 (cisco) β 10.1.1.1 β Site: HQ β VLAN: 1 β IOS: 15.2(4)E
mr-office-01 (meraki) β 10.1.2.1 β Site: Office β VLAN: 1 β Model: MR36
Run it with python3 lab3.py. Paste your output below and submit.
π‘ Show Hint
Use super().__init__(name, ip, "cisco", site, vlan) in CiscoDevice. Override get_summary() and call super().get_summary() to get the base string, then append the extra info.
Paste Your Output