Hot Topics

Teg Analytics Solution
Technical Round
SELECT customers.name, orders.order_date
FROM customers
INNER JOIN orders
ON customers.customer_id = orders.customer_id;
class Car:
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
def description(self):
return f"{self.year} {self.make} {self.model}"
In this example, the Car
class has three member variables: make
, model
, and year
. It also has a single method description
, which returns a string that describes the car. The __init__
method is a special method that is automatically called when an object of the class is created. It allows you to initialize the attributes of the object.
To create an object of the Car
class, you can write:
my_car = Car("Toyota", "Camry", 2020)
print(my_car.description())
This will output: 2020 Toyota Camry
.




Popular Category
Hot Topics
Go through our study material. Your Job is awaiting.