Commit 4c0e7f67 by Patryk Czarnik

klasa Product

parent 06faeb68
class Product:
def __init__(self, id, nazwa, cena):
self.id = id
self.nazwa = nazwa
self.cena = cena
def print_info(self):
print(f'Produkt "{self.nazwa}", id: {self.id}, cena: {self.cena} PLN')
p = Product(1, 'Woda', 10.99)
p.print_info()
print('p:', p)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment