Are you ready?
1 questions to solve.
- This quiz goes to full-screen once you press the Start button.
- At the end of the quiz, you are able to review all the questions that you answered wrong and see their explanations.
intclass represents integers while the
floatclass represents floats. See more at Python Number Basics.
3 // 2return?
//operator computes floor division. That is, it performs normal division and then floors the result. So
3 // 2returns
1, which goes with choice (A). Read more at Python Number Basics — floor division.
4 / 2return?
/division operator in Python returns a float, even if the result is an integer. Therefore
4 / 2returns
2. This goes with choice (B). More details at Python Number Basics.
esymbol in numbers denotes scientific notation. The number preceding it represents the significand while the number following it represents the order of magnitude (the power of
10). Moreover, it returns a float.
1e3represents the number
1000.0, which goes with choice (D). See more at Python Number Basics — the
type()function takes in a given value and returns back the class that represents it.
type(10), likewise, returns back the class
10is an integer in Python belonging to the class
int. For more details, refer to Python Number Basics — integers.
0. Hence, the correct choice is (A).
frepresents an integer i.e has a fractional part equal to
f.is_integer()to see if the float
frepresents an integer. It would return
Trueon integer floats such
Falseotherwise. See more at Python Number Basics —
**exponentiation operator and the
pow()function additionally enables one to perform fast modular exponentiation, by providing a third, optional argument. Hence the correct choice is (B). For a comprehensive discussion on the difference b/w
pow(), refer to Python Number Basics — difference between
3e100000resolve down to?
3e100000represents an extremely large float, that can't be held on in Python's double-precision format. Python evaluates it to
infi.e infinity. Hence, the correct choice is (A). For more details, refer to Python Number Basics — floats.