We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0f45dc commit 4303e02Copy full SHA for 4303e02
loops.ipynb
@@ -102,7 +102,7 @@
102
},
103
{
104
"cell_type": "code",
105
- "execution_count": null,
+ "execution_count": 2,
106
"metadata": {},
107
"outputs": [
108
@@ -119,9 +119,10 @@
119
"10\n",
120
"22\n",
121
"12\n",
122
- "860 yes\n",
123
- "200 yes\n",
124
- "240 yes\n"
+ "860 NO\n",
+ "200 NO\n",
+ "240 NO\n",
125
+ "[22, 12, 4, 10, 43]\n"
126
]
127
}
128
],
@@ -135,7 +136,15 @@
135
136
" print (i) \n",
137
"\n",
138
"for i in range(len(h)-1,-1,-2):\n",
- " print(h[i]*20,'NO')\n"
139
+ " print(h[i]*20,'NO')\n",
140
+ "\n",
141
+ "for i in range(0, len(h) - 1, 2):\n",
142
+ " t = h[i]\n",
143
+ " h[i] = h[i + 1]\n",
144
+ " h[i + 1] = t\n",
145
146
+ "print(h)\n",
147
+ "\n"
148
149
150
0 commit comments