From 02bd06e18576ae6ac724abd5cd2e060c2d9c25b2 Mon Sep 17 00:00:00 2001 From: Touhidul Haider <163761310+TouhidulHaider@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:40:14 +0600 Subject: [PATCH] ch1_challenge.py --- Start/Ch 1/challenge.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Start/Ch 1/challenge.py b/Start/Ch 1/challenge.py index 050cd6d..594e067 100644 --- a/Start/Ch 1/challenge.py +++ b/Start/Ch 1/challenge.py @@ -10,7 +10,13 @@ # of "Ticker: Company -- $Price" class Stock: - pass + def __init__(self, ticker, price, company): + self.ticker = ticker + self.price = price + self.company = company + + def get_description(self): + return f"{self.ticker}: {self.company} -- {self.price}" # ~~~~~~~~~ TEST CODE ~~~~~~~~~ msft = Stock("MSFT", 342.0, "Microsoft Corp")