|
43 | 43 | }, |
44 | 44 | { |
45 | 45 | "cell_type": "code", |
46 | | - "execution_count": 4, |
| 46 | + "execution_count": 3, |
47 | 47 | "metadata": {}, |
48 | 48 | "outputs": [ |
49 | 49 | { |
|
59 | 59 | "print(shopping)" |
60 | 60 | ] |
61 | 61 | }, |
| 62 | + { |
| 63 | + "cell_type": "code", |
| 64 | + "execution_count": 4, |
| 65 | + "metadata": {}, |
| 66 | + "outputs": [ |
| 67 | + { |
| 68 | + "name": "stdout", |
| 69 | + "output_type": "stream", |
| 70 | + "text": [ |
| 71 | + "['bread', 'milk', 'ham', 'eggs', 'apple', 'coffee', 'orange']\n" |
| 72 | + ] |
| 73 | + } |
| 74 | + ], |
| 75 | + "source": [ |
| 76 | + "new_shopping = ['coffee', 'orange']\n", |
| 77 | + "shopping.extend(new_shopping) \n", |
| 78 | + "print(shopping)" |
| 79 | + ] |
| 80 | + }, |
| 81 | + { |
| 82 | + "cell_type": "code", |
| 83 | + "execution_count": 5, |
| 84 | + "metadata": {}, |
| 85 | + "outputs": [ |
| 86 | + { |
| 87 | + "name": "stdout", |
| 88 | + "output_type": "stream", |
| 89 | + "text": [ |
| 90 | + "['bread', 'milk', 'eggs', 'apple', 'coffee', 'orange']\n" |
| 91 | + ] |
| 92 | + } |
| 93 | + ], |
| 94 | + "source": [ |
| 95 | + "shopping.remove('ham')\n", |
| 96 | + "print(shopping)" |
| 97 | + ] |
| 98 | + }, |
| 99 | + { |
| 100 | + "cell_type": "code", |
| 101 | + "execution_count": 6, |
| 102 | + "metadata": {}, |
| 103 | + "outputs": [ |
| 104 | + { |
| 105 | + "name": "stdout", |
| 106 | + "output_type": "stream", |
| 107 | + "text": [ |
| 108 | + "['bread', 'milk', 'apple', 'coffee', 'orange']\n" |
| 109 | + ] |
| 110 | + } |
| 111 | + ], |
| 112 | + "source": [ |
| 113 | + "shopping.pop(2)\n", |
| 114 | + "print(shopping)" |
| 115 | + ] |
| 116 | + }, |
| 117 | + { |
| 118 | + "cell_type": "code", |
| 119 | + "execution_count": 7, |
| 120 | + "metadata": {}, |
| 121 | + "outputs": [ |
| 122 | + { |
| 123 | + "name": "stdout", |
| 124 | + "output_type": "stream", |
| 125 | + "text": [ |
| 126 | + "['apple', 'bread', 'coffee', 'milk', 'orange']\n" |
| 127 | + ] |
| 128 | + } |
| 129 | + ], |
| 130 | + "source": [ |
| 131 | + "shopping.sort()\n", |
| 132 | + "print(shopping)" |
| 133 | + ] |
| 134 | + }, |
| 135 | + { |
| 136 | + "cell_type": "code", |
| 137 | + "execution_count": 8, |
| 138 | + "metadata": {}, |
| 139 | + "outputs": [ |
| 140 | + { |
| 141 | + "name": "stdout", |
| 142 | + "output_type": "stream", |
| 143 | + "text": [ |
| 144 | + "['orange', 'milk', 'coffee', 'bread', 'apple']\n" |
| 145 | + ] |
| 146 | + } |
| 147 | + ], |
| 148 | + "source": [ |
| 149 | + "shopping.sort(reverse = True)\n", |
| 150 | + "print(shopping)" |
| 151 | + ] |
| 152 | + }, |
| 153 | + { |
| 154 | + "cell_type": "code", |
| 155 | + "execution_count": 9, |
| 156 | + "metadata": {}, |
| 157 | + "outputs": [ |
| 158 | + { |
| 159 | + "data": { |
| 160 | + "text/plain": [ |
| 161 | + "2" |
| 162 | + ] |
| 163 | + }, |
| 164 | + "execution_count": 9, |
| 165 | + "metadata": {}, |
| 166 | + "output_type": "execute_result" |
| 167 | + } |
| 168 | + ], |
| 169 | + "source": [ |
| 170 | + "shopping.index('coffee')" |
| 171 | + ] |
| 172 | + }, |
62 | 173 | { |
63 | 174 | "cell_type": "code", |
64 | 175 | "execution_count": null, |
|
83 | 194 | "name": "python", |
84 | 195 | "nbconvert_exporter": "python", |
85 | 196 | "pygments_lexer": "ipython3", |
86 | | - "version": "3.7.3" |
| 197 | + "version": "3.7.4" |
87 | 198 | } |
88 | 199 | }, |
89 | 200 | "nbformat": 4, |
|
0 commit comments