Skip to content

Commit 9aaf69a

Browse files
committed
Loop added
1 parent 123e0b7 commit 9aaf69a

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

Untitled.ipynb

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"### Loops (For, While, Range)"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": 2,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"seq = [1,2,3,4,5]"
17+
]
18+
},
19+
{
20+
"cell_type": "code",
21+
"execution_count": 3,
22+
"metadata": {},
23+
"outputs": [
24+
{
25+
"name": "stdout",
26+
"output_type": "stream",
27+
"text": [
28+
"1\n",
29+
"2\n",
30+
"3\n",
31+
"4\n",
32+
"5\n"
33+
]
34+
}
35+
],
36+
"source": [
37+
"for item in seq:\n",
38+
" print(item)"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": 4,
44+
"metadata": {},
45+
"outputs": [
46+
{
47+
"name": "stdout",
48+
"output_type": "stream",
49+
"text": [
50+
"Yep\n",
51+
"Yep\n",
52+
"Yep\n",
53+
"Yep\n",
54+
"Yep\n"
55+
]
56+
}
57+
],
58+
"source": [
59+
"for item in seq:\n",
60+
" print('Yep')"
61+
]
62+
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": 5,
66+
"metadata": {},
67+
"outputs": [
68+
{
69+
"name": "stdout",
70+
"output_type": "stream",
71+
"text": [
72+
"2\n",
73+
"4\n",
74+
"6\n",
75+
"8\n",
76+
"10\n"
77+
]
78+
}
79+
],
80+
"source": [
81+
"for jelly in seq:\n",
82+
" print(jelly+jelly)"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": null,
88+
"metadata": {},
89+
"outputs": [],
90+
"source": []
91+
}
92+
],
93+
"metadata": {
94+
"kernelspec": {
95+
"display_name": "Python 3",
96+
"language": "python",
97+
"name": "python3"
98+
},
99+
"language_info": {
100+
"codemirror_mode": {
101+
"name": "ipython",
102+
"version": 3
103+
},
104+
"file_extension": ".py",
105+
"mimetype": "text/x-python",
106+
"name": "python",
107+
"nbconvert_exporter": "python",
108+
"pygments_lexer": "ipython3",
109+
"version": "3.7.4"
110+
}
111+
},
112+
"nbformat": 4,
113+
"nbformat_minor": 4
114+
}

0 commit comments

Comments
 (0)