@@ -72,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 4 ,
"execution_count": 3 ,
"metadata": {},
"outputs": [
{
@@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 5 ,
"execution_count": 4 ,
"metadata": {},
"outputs": [
{
@@ -113,7 +113,7 @@
"'apple'"
]
},
"execution_count": 5 ,
"execution_count": 4 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -131,16 +131,16 @@
},
{
"cell_type": "code",
"execution_count": 6 ,
"execution_count": 5 ,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'orange '"
"'peach '"
]
},
"execution_count": 6 ,
"execution_count": 5 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -158,7 +158,7 @@
},
{
"cell_type": "code",
"execution_count": 5 ,
"execution_count": 6 ,
"metadata": {},
"outputs": [],
"source": [
@@ -174,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 6 ,
"execution_count": 8 ,
"metadata": {},
"outputs": [
{
@@ -192,7 +192,7 @@
},
{
"cell_type": "code",
"execution_count": 7 ,
"execution_count": 9 ,
"metadata": {},
"outputs": [
{
@@ -201,7 +201,7 @@
"'orange'"
]
},
"execution_count": 7 ,
"execution_count": 9 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -222,7 +222,7 @@
},
{
"cell_type": "code",
"execution_count": 12 ,
"execution_count": 10 ,
"metadata": {},
"outputs": [
{
@@ -247,9 +247,20 @@
},
{
"cell_type": "code",
"execution_count": null ,
"execution_count": 12 ,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'apple'"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"z1[0]"
]
@@ -263,9 +274,20 @@
},
{
"cell_type": "code",
"execution_count": null ,
"execution_count": 13 ,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'apple'"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"z[0][0]"
]
@@ -295,25 +317,24 @@
},
{
"cell_type": "code",
"execution_count": 10 ,
"execution_count": 15 ,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
"name": "stdout",
"output_type": "stream",
"text": [
"[0, 1, 2, 3]\n",
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n",
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n"
]
}
],
"source": [
"num = [0,1,2,3,4,5,6,7,8,9]\n",
"num[0:4]\n",
"num[0:]\n",
"num[:]"
"print( num[0:4]) \n",
"print( num[0:]) \n",
"print( num[:]) "
]
},
{
@@ -344,7 +365,7 @@
},
{
"cell_type": "code",
"execution_count": 11 ,
"execution_count": 17 ,
"metadata": {},
"outputs": [
{
@@ -353,7 +374,7 @@
"[0, 3, 6]"
]
},
"execution_count": 11 ,
"execution_count": 17 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -378,7 +399,7 @@
},
{
"cell_type": "code",
"execution_count": 12 ,
"execution_count": 18 ,
"metadata": {},
"outputs": [
{
@@ -387,7 +408,7 @@
"10"
]
},
"execution_count": 12 ,
"execution_count": 18 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -405,7 +426,7 @@
},
{
"cell_type": "code",
"execution_count": 13 ,
"execution_count": 19 ,
"metadata": {},
"outputs": [
{
@@ -414,7 +435,7 @@
"0"
]
},
"execution_count": 13 ,
"execution_count": 19 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -425,7 +446,7 @@
},
{
"cell_type": "code",
"execution_count": 14 ,
"execution_count": 20 ,
"metadata": {},
"outputs": [
{
@@ -434,7 +455,7 @@
"9"
]
},
"execution_count": 14 ,
"execution_count": 20 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -452,7 +473,7 @@
},
{
"cell_type": "code",
"execution_count": 15 ,
"execution_count": 2 1,
"metadata": {},
"outputs": [
{
@@ -461,7 +482,7 @@
"[1, 2, 3, 5, 4, 7]"
]
},
"execution_count": 15 ,
"execution_count": 2 1,
"metadata": {},
"output_type": "execute_result"
}
@@ -479,7 +500,7 @@
},
{
"cell_type": "code",
"execution_count": 16 ,
"execution_count": 22 ,
"metadata": {},
"outputs": [],
"source": [
@@ -495,7 +516,7 @@
},
{
"cell_type": "code",
"execution_count": 18 ,
"execution_count": 23 ,
"metadata": {},
"outputs": [
{
@@ -504,7 +525,7 @@
"False"
]
},
"execution_count": 18 ,
"execution_count": 23 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -515,7 +536,7 @@
},
{
"cell_type": "code",
"execution_count": 17 ,
"execution_count": 24 ,
"metadata": {},
"outputs": [
{
@@ -524,7 +545,7 @@
"True"
]
},
"execution_count": 17 ,
"execution_count": 24 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -535,7 +556,7 @@
},
{
"cell_type": "code",
"execution_count": 19 ,
"execution_count": 26 ,
"metadata": {},
"outputs": [
{
@@ -544,7 +565,27 @@
"False"
]
},
"execution_count": 19,
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"'fire' in names"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"False"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
@@ -562,7 +603,7 @@
},
{
"cell_type": "code",
"execution_count": 20 ,
"execution_count": 27 ,
"metadata": {},
"outputs": [],
"source": [
@@ -571,7 +612,7 @@
},
{
"cell_type": "code",
"execution_count": 21 ,
"execution_count": 28 ,
"metadata": {},
"outputs": [
{
@@ -597,7 +638,7 @@
},
{
"cell_type": "code",
"execution_count": 22 ,
"execution_count": 29 ,
"metadata": {},
"outputs": [],
"source": [
@@ -606,7 +647,7 @@
},
{
"cell_type": "code",
"execution_count": 2 3,
"execution_count": 30 ,
"metadata": {},
"outputs": [
{
@@ -639,7 +680,7 @@
},
{
"cell_type": "code",
"execution_count": 22 ,
"execution_count": 31 ,
"metadata": {},
"outputs": [
{
@@ -696,7 +737,7 @@
},
{
"cell_type": "code",
"execution_count": 25 ,
"execution_count": 33 ,
"metadata": {},
"outputs": [],
"source": [
@@ -705,7 +746,7 @@
},
{
"cell_type": "code",
"execution_count": 26 ,
"execution_count": 34 ,
"metadata": {},
"outputs": [
{
@@ -730,7 +771,7 @@
},
{
"cell_type": "code",
"execution_count": 27 ,
"execution_count": 35 ,
"metadata": {},
"outputs": [
{
@@ -739,7 +780,7 @@
"3"
]
},
"execution_count": 27 ,
"execution_count": 35 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -757,7 +798,7 @@
},
{
"cell_type": "code",
"execution_count": 28 ,
"execution_count": 36 ,
"metadata": {},
"outputs": [],
"source": [
@@ -766,7 +807,7 @@
},
{
"cell_type": "code",
"execution_count": 29 ,
"execution_count": 37 ,
"metadata": {},
"outputs": [
{
@@ -791,7 +832,7 @@
},
{
"cell_type": "code",
"execution_count": 30 ,
"execution_count": 38 ,
"metadata": {},
"outputs": [
{
@@ -816,7 +857,7 @@
},
{
"cell_type": "code",
"execution_count": 31 ,
"execution_count": 39 ,
"metadata": {},
"outputs": [
{
@@ -825,7 +866,7 @@
"0"
]
},
"execution_count": 31 ,
"execution_count": 39 ,
"metadata": {},
"output_type": "execute_result"
}
@@ -836,7 +877,7 @@
},
{
"cell_type": "code",
"execution_count": 32 ,
"execution_count": 40 ,
"metadata": {},
"outputs": [
{
@@ -846,7 +887,7 @@
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-32 -344da5bcf759>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m999\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-40 -344da5bcf759>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mlst\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m999\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mValueError\u001b[0m: 999 is not in list"
]
}
@@ -864,7 +905,7 @@
},
{
"cell_type": "code",
"execution_count": 33 ,
"execution_count": 41 ,
"metadata": {},
"outputs": [
{
@@ -889,7 +930,7 @@
},
{
"cell_type": "code",
"execution_count": 3 4,
"execution_count": 42 ,
"metadata": {},
"outputs": [
{
@@ -914,7 +955,7 @@
},
{
"cell_type": "code",
"execution_count": 36 ,
"execution_count": 44 ,
"metadata": {},
"outputs": [
{
@@ -923,7 +964,7 @@
"[1, 1, 4, 8, 7, 'Python', 1, [5, 4, 2, 8], 5, 4]"
]
},
"execution_count": 36 ,
"execution_count": 44 ,
"metadata": {},
"output_type": "execute_result"
}