0
exponentiation
Why in exponentiation it is not giving answer in float? Even when we add two integers the output is in float so then why is it different in this case
2 Answers
+ 2
# your code goes here
days = 30
pennys = 0.01
double = pennys*(2**days)
print(double)
Use this man
+ 1
Arithmetic operators in Python have a rule if either of the operands is float, then the result is a float, otherwise the result is integer:
int + int = int
int + float = float
float + int = float
float + float = float