r/PythonLearning • u/Next-Call8862 • Sep 16 '26
Showcase Day 7, One Straight week
Happy that I learned for one straight week but thinking I could've learned a lot more as I wasted much of time scrolling
Today did some sorting algos and nothing much for the day
31
Upvotes
1
u/FoolsSeldom Sep 16 '26
I think you might be going a bit too fast, but impressive at this stage.
A few thoughts:
Would be worth you reading up on PEP8 guidance and applying it
For
Booby,Recursion is very wasteful in this example, and not needed, and you risk hitting Python's limits
print(a)will print atuple, not a sortedlistBoobyreturnsarr, swap, soa = (sorted_list, False)Maybe
print(a[0]), or justprint(arr)listis mutated in place anywayYour bubble sort 2 is working on an already sorted array
In your selection sort, you are shadowing the built-in
min, which is generally not a good idea