Skip to content
Snippets Groups Projects
pythonLab7.4.py 362 B
Newer Older
miskamero's avatar
miskamero committed
class Mobile:
    def __init__(self, brand, model, price):
        self.brand = brand
        self.model = model
        self.price = price
    def __str__(self):
        return f"Brand: {self.brand}\nModel: {self.model}\nPrice: {self.price}\n"
    
phone1 = Mobile("Samsung", "Galaxy", 349)
phone2 = Mobile("Apple", "iPhone 12", 899)
print(phone1)
print(phone2)