+ 6

What are some of the coding gotchas to look out for when coding in Python?

Every language has those 'gotchas' (unexpected behavior or debugging challenges). If I'm planning on doing extensive coding in Python what are some of the gotchas to be aware of?

24th Nov 2018, 7:15 PM
Ethan
7 Réponses
+ 4
I mainly get indentation error🤣
25th Nov 2018, 11:24 AM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 4
Yaa it's easy to find still I can't figure out why I did that mistake😁@HonFu
25th Nov 2018, 11:32 AM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 2
Thanks for your answer!
24th Nov 2018, 8:03 PM
Ethan
+ 2
Sarvesh ✓, yeah, these come up a lot... ;-) Occasionally you indented wrong and the program runs anyway (acting unexpectedly), then you might have to look for a while ... Most times, though, you'll get an error message about what you did wrong and where, and it should be relatively easy to find.
25th Nov 2018, 11:30 AM
HonFu
HonFu - avatar
+ 2
Sarvesh ✓, yeah, but... Did you ever have a mistake in your Python code where you didn't get an error message, everything looked okay, but then your program acted in a way you didn't want it to? And then you tried to search for it but you simply couldn't find it? #debugging CHALLENGE!
25th Nov 2018, 11:37 AM
HonFu
HonFu - avatar
+ 2
Yaa some time...😶
25th Nov 2018, 1:00 PM
Sarvesh Yadav
Sarvesh Yadav - avatar
+ 1
The problems that can occur if you fail to treat mutable and immutable types properly. (This is a link I am going to read myself later. ;)) https://medium.com/@meghamohan/mutable-and-immutable-side-of-JUMP_LINK__&&__python__&&__JUMP_LINK-c2145cf72747 EDIT: Okay, after having read that article... it's rather superficial...
24th Nov 2018, 7:41 PM
HonFu
HonFu - avatar