Q. What is the output of the Python code: print(list(range(1, 5)))?
Solution:
The range(1, 5) generates numbers from 1 to 4 (exclusive of 5), and list() converts it to [1, 2, 3, 4].
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.