Skip to content

Commit 4a8a487

Browse files
committed
moved rocket and multiplying to files
1 parent d6eb91d commit 4a8a487

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

09_classes_and_OOP.ipynb

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@
22312231
},
22322232
{
22332233
"cell_type": "code",
2234-
"execution_count": 55,
2234+
"execution_count": 2,
22352235
"metadata": {
22362236
"collapsed": false,
22372237
"slideshow": {
@@ -2248,8 +2248,8 @@
22482248
}
22492249
],
22502250
"source": [
2251-
"# Save as rocket_game.py\n",
2252-
"from rocket import Rocket\n",
2251+
"# Save in files as rocket_game.py\n",
2252+
"from files.rocket import Rocket\n",
22532253
"\n",
22542254
"rocket = Rocket()\n",
22552255
"print(\"The rocket is at (%d, %d).\" % (rocket.x, rocket.y))"
@@ -2324,7 +2324,7 @@
23242324
},
23252325
"outputs": [],
23262326
"source": [
2327-
"# Save as rocket.py\n",
2327+
"# Save in files as rocket.py\n",
23282328
"from math import sqrt\n",
23292329
"\n",
23302330
"class Rocket():\n",
@@ -2371,7 +2371,7 @@
23712371
},
23722372
{
23732373
"cell_type": "code",
2374-
"execution_count": 14,
2374+
"execution_count": 3,
23752375
"metadata": {
23762376
"collapsed": false,
23772377
"slideshow": {
@@ -2391,8 +2391,8 @@
23912391
}
23922392
],
23932393
"source": [
2394-
"# Save as rocket_game.py\n",
2395-
"from rocket import Rocket, Shuttle\n",
2394+
"# Save in files as rocket_game.py\n",
2395+
"from files.rocket import Rocket, Shuttle\n",
23962396
"\n",
23972397
"rocket = Rocket()\n",
23982398
"print(\"The rocket is at (%d, %d).\" % (rocket.x, rocket.y))\n",
@@ -2477,7 +2477,7 @@
24772477
},
24782478
{
24792479
"cell_type": "code",
2480-
"execution_count": 3,
2480+
"execution_count": 5,
24812481
"metadata": {
24822482
"collapsed": false,
24832483
"slideshow": {
@@ -2497,8 +2497,8 @@
24972497
}
24982498
],
24992499
"source": [
2500-
"# Save as rocket_game.py\n",
2501-
"import rocket\n",
2500+
"# Save in files as rocket_game.py\n",
2501+
"import files.rocket as rocket\n",
25022502
"\n",
25032503
"rocket_0 = rocket.Rocket()\n",
25042504
"print(\"The rocket is at (%d, %d).\" % (rocket_0.x, rocket_0.y))\n",
@@ -2611,7 +2611,7 @@
26112611
},
26122612
{
26132613
"cell_type": "code",
2614-
"execution_count": 5,
2614+
"execution_count": 6,
26152615
"metadata": {
26162616
"collapsed": false,
26172617
"slideshow": {
@@ -2631,8 +2631,8 @@
26312631
}
26322632
],
26332633
"source": [
2634-
"# Save as rocket_game.py\n",
2635-
"import rocket as rocket_module\n",
2634+
"# Save in files as rocket_game.py\n",
2635+
"import files.rocket as rocket_module\n",
26362636
"\n",
26372637
"rocket = rocket_module.Rocket()\n",
26382638
"print(\"The rocket is at (%d, %d).\" % (rocket.x, rocket.y))\n",
@@ -2655,7 +2655,7 @@
26552655
},
26562656
{
26572657
"cell_type": "code",
2658-
"execution_count": null,
2658+
"execution_count": 7,
26592659
"metadata": {
26602660
"collapsed": false,
26612661
"slideshow": {
@@ -2664,7 +2664,7 @@
26642664
},
26652665
"outputs": [],
26662666
"source": [
2667-
"import rocket as rocket_module"
2667+
"import files.rocket as rocket_module"
26682668
]
26692669
},
26702670
{
@@ -2680,7 +2680,7 @@
26802680
},
26812681
{
26822682
"cell_type": "code",
2683-
"execution_count": null,
2683+
"execution_count": 9,
26842684
"metadata": {
26852685
"collapsed": false,
26862686
"slideshow": {
@@ -2689,7 +2689,7 @@
26892689
},
26902690
"outputs": [],
26912691
"source": [
2692-
"import rocket as r"
2692+
"import files.rocket as r"
26932693
]
26942694
},
26952695
{
@@ -2777,7 +2777,7 @@
27772777
},
27782778
"outputs": [],
27792779
"source": [
2780-
"# Save as multiplying.py\n",
2780+
"# Save in files as multiplying.py\n",
27812781
"def double(x):\n",
27822782
" return 2*x\n",
27832783
"\n",
@@ -2801,7 +2801,7 @@
28012801
},
28022802
{
28032803
"cell_type": "code",
2804-
"execution_count": 1,
2804+
"execution_count": 11,
28052805
"metadata": {
28062806
"collapsed": false,
28072807
"slideshow": {
@@ -2820,7 +2820,7 @@
28202820
}
28212821
],
28222822
"source": [
2823-
"from multiplying import double, triple, quadruple\n",
2823+
"from files.multiplying import double, triple, quadruple\n",
28242824
"\n",
28252825
"print(double(5))\n",
28262826
"print(triple(5))\n",
@@ -2840,7 +2840,7 @@
28402840
},
28412841
{
28422842
"cell_type": "code",
2843-
"execution_count": 4,
2843+
"execution_count": 13,
28442844
"metadata": {
28452845
"collapsed": false,
28462846
"slideshow": {
@@ -2859,11 +2859,11 @@
28592859
}
28602860
],
28612861
"source": [
2862-
"import multiplying\n",
2862+
"import files.multiplying\n",
28632863
"\n",
2864-
"print(multiplying.double(5))\n",
2865-
"print(multiplying.triple(5))\n",
2866-
"print(multiplying.quadruple(5))"
2864+
"print(files.multiplying.double(5))\n",
2865+
"print(files.multiplying.triple(5))\n",
2866+
"print(files.multiplying.quadruple(5))"
28672867
]
28682868
},
28692869
{
@@ -2879,7 +2879,7 @@
28792879
},
28802880
{
28812881
"cell_type": "code",
2882-
"execution_count": 5,
2882+
"execution_count": 14,
28832883
"metadata": {
28842884
"collapsed": false,
28852885
"slideshow": {
@@ -2898,7 +2898,7 @@
28982898
}
28992899
],
29002900
"source": [
2901-
"import multiplying as m\n",
2901+
"import files.multiplying as m\n",
29022902
"\n",
29032903
"print(m.double(5))\n",
29042904
"print(m.triple(5))\n",
@@ -2918,7 +2918,7 @@
29182918
},
29192919
{
29202920
"cell_type": "code",
2921-
"execution_count": 7,
2921+
"execution_count": 15,
29222922
"metadata": {
29232923
"collapsed": false,
29242924
"slideshow": {
@@ -2937,7 +2937,7 @@
29372937
}
29382938
],
29392939
"source": [
2940-
"from multiplying import *\n",
2940+
"from files.multiplying import *\n",
29412941
"\n",
29422942
"print(double(5))\n",
29432943
"print(triple(5))\n",
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)