r/PythonLearning • u/diveninenewton • Oct 21 '25
Showcase rate my code
im learning python right now and need some feedback
170
Upvotes
r/PythonLearning • u/diveninenewton • Oct 21 '25
im learning python right now and need some feedback
28
u/Maple382 Oct 21 '25
You call the api twice, once in like 3 and once on lines 6 and 7.
You typed the same thing in lines 14 and 15, why not just make it a variable? You could call it "result".
This isn't really a problem per se, but I wouldn't do it. It's doing the replacement three times on separate lines and assigning the variable for each, it just looks ugly when you could do it all in one line instead.
I noticed you use a mix of single and double quotes, it's probably best to just stick to one.