Update ex5_6.md to fix NameError in example code

Calling Stock() directly without providing the name of the module will result in the following error:

NameError: name 'Stock' is not defined

This fixes the bug in the example code.
This commit is contained in:
Jarle Thorsen authored and GitHub committed 2023-10-23 12:27:05 +02:00
1 parent afec76dd94
commit 1d20aaeca8
1 file changed
+1 -1
+1 -1
View File
@@ -25,7 +25,7 @@ import stock
class TestStock(unittest.TestCase):
def test_create(self):
s = Stock('GOOG', 100, 490.1)
s = stock.Stock('GOOG', 100, 490.1)
self.assertEqual(s.name, 'GOOG')
self.assertEqual(s.shares, 100)
self.assertEqual(s.price, 490.1)