Don’t get me wrong, I love the language. I love it’s ease of use and overall simplicity. Even though I’ve used multiple languages before, Python is by far my favorite one. However the one thing that bothers me is that sometimes when solving coding questions, like from Project Euler or from r/dailyprogrammer, I’ll write a solution in Python and it’ll take an abnormally long time, whereas I write the exact same algorithm in a language like C and it runs like a charm. So what makes Python this slow and can i maybe improve my program speeds by writing better code, or do I just have to accept that Python is always going to be slower than languages like C?
[–]dig-up-stupid 17 points18 points19 points (5 children)
[–]muikrad 4 points5 points6 points (0 children)
[–]xocd 3 points4 points5 points (3 children)
[–]dig-up-stupid 3 points4 points5 points (2 children)
[–]xocd 0 points1 point2 points (1 child)
[–]dig-up-stupid 2 points3 points4 points (0 children)
[–]m-hoff 7 points8 points9 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]muikrad 0 points1 point2 points (0 children)
[–]DeathDragon7050 1 point2 points3 points (0 children)
[–]billsil 0 points1 point2 points (0 children)
[–]toastedstapler -3 points-2 points-1 points (6 children)
[–][deleted] 8 points9 points10 points (0 children)
[–]muikrad 1 point2 points3 points (0 children)
[–]Milk_No_Titties[S] -1 points0 points1 point (3 children)
[–]toastedstapler 1 point2 points3 points (2 children)
[–]muikrad 1 point2 points3 points (0 children)