
from itertools import count


class Pixel:
    new_id = count(1)

    def __init__(self):
        """Pixel constructor"""
        self.id = next(self.new_id)

    def __str__(self):
        return str(self.id)

    def __repr__(self):
        return self.__str__()


from itertools import count


class Pixel:
    new_id = count(1)

    def __init__(self, data=None):
        """Pixel constructor"""
        self.id = next(self.new_id)
        self.data = data

    def __str__(self):
        return str(self.data)

Add data dict as Pixel member.
Add data dict as Pixel member.

  
  from itertools import count
  
  
  class Pixel:
      new_id = count(1)
  
-     def __init__(self):
+     def __init__(self, data=None):
          """Pixel constructor"""
          self.id = next(self.new_id)
+         self.data = data
  
      def __str__(self):
-         return str(self.id)
+         return str(self.data)
  
-     def __repr__(self):
-         return self.__str__()
- 
Add data dict as Pixel member.
## Code Before:

from itertools import count


class Pixel:
    new_id = count(1)

    def __init__(self):
        """Pixel constructor"""
        self.id = next(self.new_id)

    def __str__(self):
        return str(self.id)

    def __repr__(self):
        return self.__str__()

## Instruction:
Add data dict as Pixel member.
## Code After:

from itertools import count


class Pixel:
    new_id = count(1)

    def __init__(self, data=None):
        """Pixel constructor"""
        self.id = next(self.new_id)
        self.data = data

    def __str__(self):
        return str(self.data)
