From the course: Python Object-Oriented Programming
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Solution: Stocks - Python Tutorial
From the course: Python Object-Oriented Programming
Solution: Stocks
(upbeat music) - [Narrator] For this challenge, we needed to create a class to represent information about a company stock symbol. So in my code, I've modified the stock class to override the init function and declare three properties, one each for the ticker, the price, and the company description. And I've also defined a function named get description, which was part of the original requirements. And that function returns a string that combines the values of the properties in the specified order that was required. So let's go ahead and try running this. You can see I've got some sample test code down here for the Google stock ticker, and I'm going to test my code, and you can see that my string is being returned correctly. So let's try another one. Let's try IBM and let's make that a different value. And let's make this IBM Corp. And let's run again. All right, and once again, you can see that that's correct. Now, if you encountered an error in your result, try making sure that your…