Complete the code to import the module needed for abstract base classes.
from [1] import ABC, abstractmethod
The abc module provides the tools to create abstract base classes in Python.
Complete the code to define an abstract base class named Vehicle.
class Vehicle([1]): @abstractmethod def move(self): pass
object instead of ABC.The class must inherit from ABC to be an abstract base class.
Fix the error in the method declaration to make it abstract.
class Shape(ABC): @abstractmethod def [1](self): pass
The method name should be a normal method name like area. The decorator @abstractmethod above makes it abstract.
Fill both blanks to create a subclass Car that implements the abstract method move.
class Car([1]): def [2](self): print('Car is moving')
The subclass Car inherits from Vehicle and implements the abstract method move.
Fill all three blanks to create an abstract base class Animal with an abstract method sound and a concrete method sleep.
class Animal([1]): @[2] def [3](self): pass def sleep(self): print('Sleeping...')
The class inherits from ABC, the method is decorated with @abstractmethod, and the method name is sound.