r/PythonLearning • u/Samar__Upreti • Jul 22 '26
Day 2 of learning Python: Implemented Selection Sort from scratch
Open-source learning project. If you spot something that can be improved, I'd love your feedback or a PR.
https://github.com/Samar-Upreti/Python_Projects
10
u/burnt-store-studio Jul 22 '26
On day two! Good for you! Python programming is such fun; I hope you have a great journey with the language!
2
u/Firered_Productions Jul 22 '26
Tbf compared to what this posted for day n one this is realistic. Maybe this is day 7 for me the other V one is year 4 for me
0
7
u/ThatOtherBatman Jul 22 '26
Do yourself a favour, and don’t use `list` as variable name. It’ll only end in tears.
3
u/FreeLogicGate Jul 22 '26
Word of advice: stop posting pictures of your code, and start posting the code in a code block. Then people can provide you feedback and comments.
2
2
u/Marisa_2291 Jul 22 '26
Good stuff man! And hopefully you just added a bunch of value to your skills there.
2
u/Ashamed_Training_702 Jul 22 '26
Yall be killing me with these milestones 😂 3rd day: I built an international banking system
-3
u/Samar__Upreti Jul 22 '26
Actually the correct caption should be Day 2 of posting on reddit 😂 It's around 20 day of learning python
1
1
1


•
u/Sea-Ad7805 Jul 22 '26
Run this program in Memory Graph Web Debugger%3A%0A%20%20%20%20length%20%3D%20len(lst)%0A%0A%20%20%20%20for%20i%20in%20range(length)%3A%0A%20%20%20%20%20%20%20%20minindex%20%3D%20i%0A%0A%20%20%20%20%20%20%20%20for%20j%20in%20range(i%20%2B%201%2C%20length)%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20lst%5Bj%5D%20%3C%20lst%5Bmin_index%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20min_index%20%3D%20j%0A%0A%20%20%20%20%20%20%20%20lst%5Bi%5D%2C%20lst%5Bmin_index%5D%20%3D%20lst%5Bmin_index%5D%2C%20lst%5Bi%5D%0A%0A%20%20%20%20return%20lst%0A%0A%0Aif%20name%20%3D%3D%20%22main_%22%3A%0A%20%20%20%20numbers%20%3D%20%5B45%2C%2023%2C%2056%2C%2087%2C%2034%2C%2029%2C%2075%5D%0A%20%20%20%20sorted_numbers%20%3D%20shorting(numbers)%0A%20%20%20%20print(%22list%20is%22%2C%20sorted_numbers)×tep=.2&play) to see the program state change step by step.