python-mastery/Solutions/1_5/stock.py

10 lines
211 B
Python
Raw Normal View History

2023-07-17 03:21:00 +02:00
# stock.py
class Stock:
def __init__(self, name, shares, price):
self.name = name
self.shares = shares
self.price = price
def cost(self):
return self.shares * self.price