Skip to content

Commit f31f7dd

Browse files
committed
Add step to slicing
1 parent d933df3 commit f31f7dd

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

Basics.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,10 +1646,10 @@
16461646
"id": "28090f09-ec56-4638-8238-d5f09a764a7a",
16471647
"metadata": {
16481648
"editable": true,
1649+
"remove_code": "non-comments",
16491650
"slideshow": {
16501651
"slide_type": ""
16511652
},
1652-
"remove_code": "non-comments",
16531653
"tags": []
16541654
},
16551655
"outputs": [],
@@ -1869,6 +1869,17 @@
18691869
"# Print a slice of the list from the beginning\n"
18701870
]
18711871
},
1872+
{
1873+
"cell_type": "code",
1874+
"execution_count": null,
1875+
"id": "98a15c5a",
1876+
"metadata": {},
1877+
"outputs": [],
1878+
"source": [
1879+
"# show step\n",
1880+
"print(my_list[0:5:2]) # show every second element"
1881+
]
1882+
},
18721883
{
18731884
"cell_type": "code",
18741885
"execution_count": null,

Basics_filled.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,10 +2415,10 @@
24152415
"id": "28090f09-ec56-4638-8238-d5f09a764a7a",
24162416
"metadata": {
24172417
"editable": true,
2418+
"remove_code": "non-comments",
24182419
"slideshow": {
24192420
"slide_type": ""
24202421
},
2421-
"remove_code": "non-comments",
24222422
"tags": []
24232423
},
24242424
"outputs": [],
@@ -2656,6 +2656,17 @@
26562656
"print(my_list[:2]) # More slicing"
26572657
]
26582658
},
2659+
{
2660+
"cell_type": "code",
2661+
"execution_count": null,
2662+
"id": "98a15c5a",
2663+
"metadata": {},
2664+
"outputs": [],
2665+
"source": [
2666+
"# show step\n",
2667+
"print(my_list[0:5:2]) # show every second element"
2668+
]
2669+
},
26592670
{
26602671
"cell_type": "code",
26612672
"execution_count": null,

0 commit comments

Comments
 (0)