Skip to content

Commit 81eda2b

Browse files
committed
update code
1 parent 9a691c8 commit 81eda2b

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

Code/01_foundation_oop.ipynb

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@
5858
},
5959
{
6060
"cell_type": "code",
61-
"execution_count": null,
61+
"execution_count": 1,
6262
"metadata": {},
6363
"outputs": [],
6464
"source": [
65-
"from pprint import pprint\n",
6665
"from colorama import Fore "
6766
]
6867
},
@@ -113,7 +112,7 @@
113112
},
114113
{
115114
"cell_type": "code",
116-
"execution_count": null,
115+
"execution_count": 2,
117116
"metadata": {},
118117
"outputs": [
119118
{
@@ -270,15 +269,15 @@
270269
},
271270
{
272271
"cell_type": "code",
273-
"execution_count": 6,
272+
"execution_count": 5,
274273
"metadata": {},
275274
"outputs": [
276275
{
277276
"name": "stdout",
278277
"output_type": "stream",
279278
"text": [
280279
"obj1.pay_rising = 0.1, obj2.pay_rising = 0.1\n",
281-
"obj1.pay = 2420, obj2.pay = 3025\n"
280+
"obj1.pay = 2200, obj2.pay = 2750\n"
282281
]
283282
}
284283
],
@@ -296,15 +295,15 @@
296295
},
297296
{
298297
"cell_type": "code",
299-
"execution_count": 7,
298+
"execution_count": 6,
300299
"metadata": {},
301300
"outputs": [
302301
{
303302
"name": "stdout",
304303
"output_type": "stream",
305304
"text": [
306305
"obj1.pay_rising = 0.15, obj2.pay_rising = 0.1\n",
307-
"\u001b[32mobj1.pay = 2783, obj2.pay = 3327\n"
306+
"\u001b[32mobj1.pay = 2530, obj2.pay = 3025\n"
308307
]
309308
}
310309
],
@@ -325,16 +324,16 @@
325324
},
326325
{
327326
"cell_type": "code",
328-
"execution_count": 8,
327+
"execution_count": 7,
329328
"metadata": {},
330329
"outputs": [
331330
{
332331
"name": "stdout",
333332
"output_type": "stream",
334333
"text": [
335-
"\u001b[35mobj1.__dict__ = {'name': 'Sara', 'lname': 'abc', 'age': 20, 'pay': 2783, 'pay_rising': 0.15}\n",
336-
"obj2.__dict__ = {'name': 'Tom', 'lname': 'frt', 'age': 30, 'pay': 3327}\n",
337-
"Person.__dict__ = mappingproxy({'__module__': '__main__', 'pay_rising': 0.1, '__init__': <function Person.__init__ at 0x0000017848C9EC00>, 'pay_increase': <function Person.pay_increase at 0x0000017848C9ED40>, '__dict__': <attribute '__dict__' of 'Person' objects>, '__weakref__': <attribute '__weakref__' of 'Person' objects>, '__doc__': None})\n"
334+
"\u001b[35mobj1.__dict__ = {'name': 'Sara', 'lname': 'abc', 'age': 20, 'pay': 2530, 'pay_rising': 0.15}\n",
335+
"obj2.__dict__ = {'name': 'Tom', 'lname': 'frt', 'age': 30, 'pay': 3025}\n",
336+
"Person.__dict__ = mappingproxy({'__module__': '__main__', 'pay_rising': 0.1, '__init__': <function Person.__init__ at 0x0000023E4147EFC0>, 'pay_increase': <function Person.pay_increase at 0x0000023E4147F100>, '__dict__': <attribute '__dict__' of 'Person' objects>, '__weakref__': <attribute '__weakref__' of 'Person' objects>, '__doc__': None})\n"
338337
]
339338
}
340339
],
@@ -371,7 +370,7 @@
371370
},
372371
{
373372
"cell_type": "code",
374-
"execution_count": 9,
373+
"execution_count": 8,
375374
"metadata": {},
376375
"outputs": [
377376
{
@@ -422,7 +421,7 @@
422421
},
423422
{
424423
"cell_type": "code",
425-
"execution_count": null,
424+
"execution_count": 9,
426425
"metadata": {},
427426
"outputs": [
428427
{
@@ -441,7 +440,7 @@
441440
},
442441
{
443442
"cell_type": "code",
444-
"execution_count": null,
443+
"execution_count": 10,
445444
"metadata": {},
446445
"outputs": [
447446
{
@@ -465,7 +464,7 @@
465464
},
466465
{
467466
"cell_type": "code",
468-
"execution_count": null,
467+
"execution_count": 11,
469468
"metadata": {},
470469
"outputs": [
471470
{
@@ -479,7 +478,7 @@
479478
}
480479
],
481480
"source": [
482-
"print(Fore.CYAN + f\"{obj1.__dict__ = }\\n{obj2.__dict__ = }\\n{obj3.__dict__ = }\")\n"
481+
"print(Fore.CYAN + f\"{obj1.__dict__ = }\\n{obj2.__dict__ = }\\n{obj3.__dict__ = }\")"
483482
]
484483
},
485484
{
@@ -496,7 +495,7 @@
496495
},
497496
{
498497
"cell_type": "code",
499-
"execution_count": null,
498+
"execution_count": 12,
500499
"metadata": {},
501500
"outputs": [
502501
{
@@ -566,7 +565,7 @@
566565
},
567566
{
568567
"cell_type": "code",
569-
"execution_count": null,
568+
"execution_count": 13,
570569
"metadata": {},
571570
"outputs": [
572571
{

0 commit comments

Comments
 (0)