File name
Commit message
Commit date
File name
Commit message
Commit date
{
"cells": [
{
"cell_type": "code",
"execution_count": 27,
"id": "8cde316d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3]"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = [1, 2, 3]\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "31a658b6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['Life', ' is', 'too', 'short']"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b = [\"Life\", \" is\", \"too\", \"short\"]\n",
"b"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "af028ec4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 'Life', 'is']"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = [1, 2, \"Life\", \"is\"]\n",
"c"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "aed75dc2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, [3, 4], ['Life', 'is']]"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = [1, 2, [3, 4], [\"Life\", \"is\"]]\n",
"d"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "b9d56702",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a[1]"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "2fdf5bdd",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"'short'"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b[-1]"
]
},
{
"cell_type": "code",
"execution_count": 37,
"id": "a1e6399b",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"4"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[2][-1]"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "698645c1",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"['Life', 'is']"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[-1]"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "9a0e2d6f",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"'Life'"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[-1][-2]"
]
},
{
"cell_type": "code",
"execution_count": 44,
"id": "f557f756",
"metadata": {
"collapsed": true
},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, [3, 4]]"
]
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d[0:3]"
]
},
{
"cell_type": "code",
"execution_count": 46,
"id": "313e2152",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3, 'Life', ' is', 'too', 'short']"
]
},
"execution_count": 46,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a+b"
]
},
{
"cell_type": "code",
"execution_count": 49,
"id": "9959a5e2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Life'"
]
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"b[0]"
]
},
{
"cell_type": "code",
"execution_count": 53,
"id": "0ead5b30",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'1hi ~^^`'"
]
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"str(a[0]) + \"hi ~^^`\""
]
},
{
"cell_type": "code",
"execution_count": 54,
"id": "c574311e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3]"
]
},
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 61,
"id": "5430555e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"int('1') + int('2')"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "4e293d6c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3, 1, 2, 3, 1, 2, 3]"
]
},
"execution_count": 62,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a * 3"
]
},
{
"cell_type": "code",
"execution_count": 63,
"id": "4a7633f8",
"metadata": {},
"outputs": [],
"source": [
"del a[0]"
]
},
{
"cell_type": "code",
"execution_count": 66,
"id": "8e38fefe",
"metadata": {},
"outputs": [],
"source": [
"a.insert(0, a)"
]
},
{
"cell_type": "code",
"execution_count": 69,
"id": "82628ba6",
"metadata": {},
"outputs": [],
"source": [
"del a[1]"
]
},
{
"cell_type": "code",
"execution_count": 70,
"id": "de133692",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[...], 3]"
]
},
"execution_count": 70,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 72,
"id": "240e416a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 72,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"del a[0]\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 73,
"id": "1326585c",
"metadata": {},
"outputs": [],
"source": [
"a = [1, 2, 3]"
]
},
{
"cell_type": "code",
"execution_count": 74,
"id": "0ef8d1be",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 3]"
]
},
"execution_count": 74,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 76,
"id": "5164f42d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['a', 'b', 'c']"
]
},
"execution_count": 76,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"aa = ['a', 'b', 'c']\n",
"aa"
]
},
{
"cell_type": "code",
"execution_count": 79,
"id": "e2e38fff",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['a', 'b', 'd']"
]
},
"execution_count": 79,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"aa[2] = 'd'\n",
"aa"
]
},
{
"cell_type": "code",
"execution_count": 84,
"id": "314b0a27",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['a', ['x', 'y', 'z'], 'd']"
]
},
"execution_count": 84,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"aa[1] = ['x', 'y', 'z']\n",
"aa"
]
},
{
"cell_type": "code",
"execution_count": 86,
"id": "0037cf3e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 2, 99]"
]
},
"execution_count": 86,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a[-1] = 99\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 87,
"id": "d64845b1",
"metadata": {},
"outputs": [],
"source": [
"a[1:2] = ['a', 'b', 'c']"
]
},
{
"cell_type": "code",
"execution_count": 88,
"id": "1aae50c5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 'a', 'b', 'c', 99]"
]
},
"execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 89,
"id": "e23db83f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 'a', 'b', 'c', ['d', 'e', 'f']]"
]
},
"execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a[-1] = ['d', 'e', 'f']\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 90,
"id": "5d5242e4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 'a', 'b', 'c']"
]
},
"execution_count": 90,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"del a[-1]\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 91,
"id": "5bac08af",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 'a', 'b', 'c', 5]"
]
},
"execution_count": 91,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.append(5)\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 95,
"id": "168ece29",
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"['__add__',\n",
" '__class__',\n",
" '__class_getitem__',\n",
" '__contains__',\n",
" '__delattr__',\n",
" '__delitem__',\n",
" '__dir__',\n",
" '__doc__',\n",
" '__eq__',\n",
" '__format__',\n",
" '__ge__',\n",
" '__getattribute__',\n",
" '__getitem__',\n",
" '__gt__',\n",
" '__hash__',\n",
" '__iadd__',\n",
" '__imul__',\n",
" '__init__',\n",
" '__init_subclass__',\n",
" '__iter__',\n",
" '__le__',\n",
" '__len__',\n",
" '__lt__',\n",
" '__mul__',\n",
" '__ne__',\n",
" '__new__',\n",
" '__reduce__',\n",
" '__reduce_ex__',\n",
" '__repr__',\n",
" '__reversed__',\n",
" '__rmul__',\n",
" '__setattr__',\n",
" '__setitem__',\n",
" '__sizeof__',\n",
" '__str__',\n",
" '__subclasshook__',\n",
" 'append',\n",
" 'clear',\n",
" 'copy',\n",
" 'count',\n",
" 'extend',\n",
" 'index',\n",
" 'insert',\n",
" 'pop',\n",
" 'remove',\n",
" 'reverse',\n",
" 'sort']"
]
},
"execution_count": 95,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dir(a)"
]
},
{
"cell_type": "code",
"execution_count": 101,
"id": "0a2db3b0",
"metadata": {},
"outputs": [],
"source": [
"a= [65, 65, 99, 8, 1, 32]\n",
"a.sort()"
]
},
{
"cell_type": "code",
"execution_count": 102,
"id": "38aa5194",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[1, 8, 32, 65, 65, 99]"
]
},
"execution_count": 102,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 103,
"id": "4aaafa7f",
"metadata": {},
"outputs": [],
"source": [
"a.reverse()"
]
},
{
"cell_type": "code",
"execution_count": 104,
"id": "265f3fd5",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[99, 65, 65, 32, 8, 1]"
]
},
"execution_count": 104,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 107,
"id": "157dd4a1",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"5"
]
},
"execution_count": 107,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.index(1)"
]
},
{
"cell_type": "code",
"execution_count": 108,
"id": "82bcebf2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[99, 65, 65, 32, 8, 1]"
]
},
"execution_count": 108,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": 109,
"id": "0e9118f6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 'c', 'b', 'a', 1, 55]"
]
},
"execution_count": 109,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = [5, 'c', 'b', 'a', 1, 55]\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 110,
"id": "8d08f643",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 88, 'c', 'b', 'a', 1, 55]"
]
},
"execution_count": 110,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.insert(1, 88)\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 111,
"id": "b717dcac",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 88, 'c', 'b', 'Hello', 'a', 1, 55]"
]
},
"execution_count": 111,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a.insert(4, \"Hello\")\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 112,
"id": "604d77dd",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 'c', 'b', 'Hello', 'a', 1, 55]"
]
},
"execution_count": 112,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"del a[1]\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 113,
"id": "de2baeaf",
"metadata": {},
"outputs": [],
"source": [
"a.remove('Hello')"
]
},
{
"cell_type": "code",
"execution_count": 114,
"id": "b1679dcf",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[5, 'c', 'b', 'a', 1, 55]"
]
},
"execution_count": 114,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "69927842",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "702e5b62",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "7c304140",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3d5e038d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "b82f2523",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "a04aa98c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "2c00c223",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "e4f1ff19",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "5195397a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "62f42eb5",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "44eaef61",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "a75af6bc",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f75e538b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0a7b9318",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}