class Car:
"""This class represents a car object."""
def __init__(self, speed=0):
self.speed = speed
self.odometer = 0
self.time = 0
# self.passengers = ['Lena', 'Benjamin', 'Tom']
def say_state(self):
"""Prints the current speed in kilometers per hour."""
print("I'm going {} kph!".format(self.speed))
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
def where_is(point):
match point:
case Point(x=0, y=0):
print("Origin")
case Point(x=0, y=y):
print(f"Y={y}")
case Point(x=x, y=0):
print(f"X={x}")
case Point():
print("Somewhere else")
case _:
print("Not a point")