Computer Science
Write the output of the following code:
a = 10/2
b = 10//3
print(a, b)
- 5 3.3
- 5.0 3.3
- 5.0 3
- 5 4
Python Data Handling
5 Likes
Answer
5.0 3
Reason — The expression a = 10/2
performs floating-point division, resulting in a
being assigned the value 5.0. Similarly, the expression b = 10//3
performs integer division (floor division), resulting in b
being assigned the value 3. The print(a, b) statement prints the values of variables a
and b
, which are 5.0 and 3 respectively.
Answered By
1 Like
Related Questions
Which value type does input() return ?
- Boolean
- String
- Int
- Float
Which of the following is a valid relational operator in Python ?
- +
- **
- >
- and
Which of the following is a valid variable name ?
- Student Name
- 3Number
- \%Name\%
- Block_number
Assertion (A): Every small unit in a Python programming statement is termed as a token.
Reasoning (R): Tokens are not interpreted but are an integral part while designing the code.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.