+ 1
Hello new to coding and I wanted to ask why doesn't my code become a float when I run it
2 Answers
+ 3
because you're multiplying full numbers. That will never result in a float.
if you want to force it to be a float:
print(float(2**2))
Keith no worries.
P.S. regular division between whole numbers always results in a float (unless forced with typecasting like above)
+ 2
Thanks Slick