Is (6 * 7) a float. As described, (6 * 7.0) is a float | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is (6 * 7) a float. As described, (6 * 7.0) is a float

Unable to understand the term float.

19th Jun 2019, 12:33 PM
Priyanshu Gaurav
2 Answers
0
A float is a number with decimal points. To have a float output, you need to have at least 1 float in the input. 6 * 7 isn't a float.
19th Jun 2019, 12:57 PM
Airree
Airree - avatar
0
In Python, what ever arithmetic operation you perform on 2 numbers, the result is always float if atleast one of the operands is a float, otherwise it is an integer. (Few exceptions: ZeroDivisionError, xroot from a negative number results a complex number.
19th Jun 2019, 6:21 PM
Seb TheS
Seb TheS - avatar