Welcome to Documenting python’s documentation!

Indices and tables

Car Module

This is a module that created a car store, that collects and presents items from a Car Factory.

class tap16.BMW(**arg)
__init__(**arg)

Creates BMW class. Inherits Car class.

Parameters:
  • arg (dict) – Contains info about BMW car.
  • type (str) – What type of car it is. It is part of arg, the key is type.
  • doors (int) – How many doors the car has. It is part of arg, the key is doors.
  • fuel (Fuel) – What type of fuel it uses. It is part of arg, the key is fuel.
class tap16.Car

This is the superclass for the different types of cars.

__init__()

This is the constructor for the Car class.

Parameters:self (Car) – The instance of this object.
__str__()

Prints: This car is a {s.model}: {s.type}, Wow! The car has {s.doors} doors and {s.seets} seats

Returns:Returns the custom string that shows what model it is and the capacity of the car.
print_model()

Prints out the model of the current car. It uses self.model and self.type

Parameters:self (Car) – The instance of this object.
Returns:Nothing
Return type:None
print_space()

Prints how many doors and seats in the current car. It uses self.doors and self.seets.

Parameters:self (Car) – The instance of this object.
Returns:Nothing
Return type:None
class tap16.CarFactory(**kwargs)

The car factory class.

__init__(**kwargs)

Creates a self.car variable from kwargs.

Parameters:
  • kwargs (dict) – Gathers info needed to store into self.car
  • car_type – The model of a car.
  • doors (int) – How many doors the car has.
  • fuel (Fuel) – The type of fuel it uses.
get_car()

Returns the self.car dictionary. :return: self.car

class tap16.CarStore(**kwargs)

The Car Store class.

__init__(**kwargs)

Creates a dictionary called self._car_factory from kwargs.

Parameters:
  • kwargs (dict) – Gathers info needed for the dictionary.
  • CarFactory (CarFactory) – Uses the class CarFactory, and passes the kwargs through here. See CarFactory for the kwargs needed.
__str__()
Returns:Returns a custom string for all the cars in inventory.
show_car(car=None)

Shows a car and what fuel it uses. If the is no car specified, it will get one from the factory.

Parameters:car (Car) – A car to be displayed. Default: None
Returns:Nothing
Return type:None
show_inventory()

Goes through the inventory, and uses the show_car function to display all cars in inventory. :return: Nothing :rtype: None

class tap16.Fuel(**arg)

The fuel of a car.

__init__(**arg)
Parameters:
  • arg (dict) – Contains info about the fuel of a car.
  • liters (int) – How many litres a car uses.
  • type (str) – What type of fuel the car uses. It is a part of arg, the key is type.
__str__()

Prints: It uses {s.liters}L of {s.type}¢.

Returns:Returns a custom string that shows how many litres of a fuel a car uses.
class tap16.Lada(**arg)
__init__(**arg)

Creates BMW class. Inherits Car class.

Parameters:
  • arg (dict) – Contains info about BMW car.
  • type (str) – What type of car it is. It is part of arg, the key is type.
  • doors (int) – How many doors the car has. It is part of arg, the key is doors.
  • fuel (Fuel) – What type of fuel it uses. It is part of arg, the key is fuel.
class tap16.Mercedes(**arg)
__init__(**arg)

Creates BMW class. Inherits Car class.

Parameters:
  • arg (dict) – Contains info about BMW car.
  • type (str) – What type of car it is. It is part of arg, the key is type.
  • doors (int) – How many doors the car has. It is part of arg, the key is doors.
  • fuel (Fuel) – What type of fuel it uses. It is part of arg, the key is fuel.