Python is regarded as one of the most powerful programming languages. And we all know that "with great power comes great responsibility". Therefore, it is the responsibility of the programmer to ensure they don't run into some of the inbuilt bugs in ...

Markdown supported · ⌘↵ to post
return balance - amountLine breaks in Python or any language assumes that a new statement has started. Python is a dynamic language, so you can't simply check for compilation errors and end of a statement
;is not used in Python. So in the above codebalanceis returned. The interpreter never reaches- amountwhich never throws a error.To write a statement in multiple lines you use
\character to notify the interpreter that the next line is a part of the current statement.return balance \ # Line below is a part of current statement. - amountAlso floating point is not a bug of python but the underlying platform handling numbers. It happens because it is the way the underlying c platform (on which python works in a sense) handles floating-point numbers. Floating point error is not a bug. Stackoverflow
PS : Apologies. My intensions are not to criticize. Just sharing my opinions.