0

0.01 is not callable

# your code goes here aux = 0 day = 30 mon = 0 while day < aux: mon = mon + ( 0.01(2**aux)) aux =+ 1 print(mon) In line 6 I have a problem , how could I solve?

26th Sep 2021, 1:49 AM
Leonardo Ampuero Terceros
Leonardo Ampuero Terceros - avatar
7 Respostas
+ 1
Without the "*" python assumes you're trying to call a function called "0.01()". That's why the error message says "0.01 is not callable".
26th Sep 2021, 2:24 AM
Simon Sauter
Simon Sauter - avatar
+ 1
What are you trying to do? What is the expected output?
26th Sep 2021, 2:00 AM
Simon Sauter
Simon Sauter - avatar
+ 1
In everyday maths we often abbreviate "x * y" to "xy". In Python you can't do that; you always have to use "*".
26th Sep 2021, 2:18 AM
Simon Sauter
Simon Sauter - avatar
+ 1
Thanks, I forgot the "*" 😅
26th Sep 2021, 2:19 AM
Leonardo Ampuero Terceros
Leonardo Ampuero Terceros - avatar
0
Since day = 30 and aux = 0 day < aux is False. Therefore the loop will not be executed and the output is 0.
26th Sep 2021, 1:58 AM
Simon Sauter
Simon Sauter - avatar
0
I'm solving the problem of one excercise that I have to do 0.01(2**n) and when I'm trying to run, show 0.01 is not callable
26th Sep 2021, 2:15 AM
Leonardo Ampuero Terceros
Leonardo Ampuero Terceros - avatar
0
There is an operator missing between 0.01 and (2**aux). Most likely what you want is 0.01 * (2**aux)
26th Sep 2021, 2:16 AM
Simon Sauter
Simon Sauter - avatar