Skip to content

Commit 9a26f9e

Browse files
committed
soring using loop
1 parent b641d26 commit 9a26f9e

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

loops.ipynb

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,34 @@
4747
" i = i+1;"
4848
]
4949
},
50+
{
51+
"cell_type": "code",
52+
"execution_count": null,
53+
"metadata": {},
54+
"outputs": [
55+
{
56+
"name": "stdout",
57+
"output_type": "stream",
58+
"text": [
59+
"[1, 3, 4, 5, 6, 6]\n"
60+
]
61+
}
62+
],
63+
"source": [
64+
"arr = [1, 5, 6, 3, 4, 6]\n",
65+
"\n",
66+
"n = len(arr)\n",
67+
"\n",
68+
"for i in range(n):\n",
69+
" for j in range(n - 1 - i): # reduce comparisons each pass\n",
70+
" if arr[j] > arr[j + 1]:\n",
71+
" arr[j], arr[j + 1] = arr[j + 1], arr[j]\n",
72+
"\n",
73+
"print(arr)\n",
74+
"\n",
75+
"\n"
76+
]
77+
},
5078
{
5179
"cell_type": "code",
5280
"execution_count": null,
@@ -71,7 +99,7 @@
7199
"name": "python",
72100
"nbconvert_exporter": "python",
73101
"pygments_lexer": "ipython3",
74-
"version": "3.12.4"
102+
"version": "3.13.2"
75103
}
76104
},
77105
"nbformat": 4,

pandas.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"cell_type": "code",
23-
"execution_count": null,
23+
"execution_count": 1,
2424
"id": "07e0d62b",
2525
"metadata": {},
2626
"outputs": [
@@ -38,7 +38,8 @@
3838
"2 Fade way\n",
3939
"P-00089\n",
4040
"MARMUL FALCON TRADE & Co\n",
41-
"Believer\n"
41+
"Believer\n",
42+
"LIFTEX TRADING GP L.L.C-FZ\n"
4243
]
4344
}
4445
],

0 commit comments

Comments
 (0)