1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Object-Oriented Programming in Python

Connected

Exercise

Creating a Network of Computers

Now, you'll overload the + operator to create a Network of devices when two Computers are added. The following class has already been defined for you:

class Network:
  def __init__(self, ip_addresses):
    self.ip_addresses = ip_addresses

Here, ip_addresses is a list of IP addresses, each a string of numbers and dots.

Instructions 1/3

undefined XP
    1
    2
    3
  • Create a Computer class with a constructor that takes two parameters; operating_system and ip_address.