Skip to content

Commit 0f52f6f

Browse files
committed
YTuple Convertion
1 parent e9bea89 commit 0f52f6f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Tuples.ipynb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,30 @@
146146
"print(thistuple[2:5])"
147147
]
148148
},
149+
{
150+
"cell_type": "code",
151+
"execution_count": 13,
152+
"metadata": {},
153+
"outputs": [
154+
{
155+
"name": "stdout",
156+
"output_type": "stream",
157+
"text": [
158+
"['apple', 'kiwi', 'cherry']\n",
159+
"('apple', 'kiwi', 'cherry')\n"
160+
]
161+
}
162+
],
163+
"source": [
164+
"x = (\"apple\", \"banana\", \"cherry\")\n",
165+
"y = list(x)\n",
166+
"y[1] = \"kiwi\"\n",
167+
"x = tuple(y)\n",
168+
"\n",
169+
"print(y)\n",
170+
"print(x)"
171+
]
172+
},
149173
{
150174
"cell_type": "code",
151175
"execution_count": null,

0 commit comments

Comments
 (0)