witam, prosta klasa
class Product:
product_count = 0
def __init__(self,name,price,category):
Product.product_count += 1
self.name = name
self.price = price
self.category = category
def show_info(self):
print(self.name)
print(self.price)
print(self.category)
p1 = Product('Kiełbasa', 12, 'Jedzonko')
print(p1.show_info())
Na ekranie widze:
Kiełbasa
12
Jedzonko
None
Czym jest None i skad sie bierze? :O