Screen Link: https://app.dataquest.io/m/1007/programming-in-python-practice-problems/7/how-many-seconds
Wrong;
print(12 * 3600 + 30 * 60)
Output: TypeErrorTraceback (most recent call last)
in ()
----> 1 print(12 * 3600 + 30 * 60)
TypeError: ‘float’ object is not callable
Correct;
print(3600 * 12 + 60 * 30)
Output: 45000
Why are the outputs not the same even though the input is the same but in different order?
Hi @saidulislam1356 . The kind of error you’re seeing isn’t related to the order (it works fine when I enter it on my screen). Check out this post about the 'x' object is not callable
error and what you can do to resolve it:
Introduction
On your programming journey, there is a high chance that you will come across this weird error message that is ‘int’/‘float’/’something_else’ object is not callable. The reason we get this error message is that we accidentally redefine built-in / user-defined functions by using them as variables. In this post, we will go through some examples of this error and how to debug it.
Note
Another way to get this error is by purposefully calling a variable name as if it’s a function name j…