What is the output of range(5)?
-
A
1,2,3,4,5
-
B
0,1,2,3,4
Correct answer
-
C
0,1,2,3,4,5
-
D
1,2,3,4
Correct answer
B. 0,1,2,3,4
13 views
Explanation
range(5) generates 0, 1, 2, 3, 4 (five numbers starting from 0). Source: Standard Python content (FBISE-aligned).
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ