ExamVeda
Login
Home
Introduction to Python
?

What does the range() function in Python generate?

Answer & Solution
Correct Answer: Option A
The range() function in Python generates a sequence of integers.
When called with one argument, range(n) produces a sequence of integers from 0 up to (but not including) n. When called with two arguments, range(start, stop) produces a sequence of integers from start up to (but not including) stop. The range() function is commonly used in for loops to iterate over a sequence of numbers. It provides a convenient way to generate sequences of integers without needing to manually specify each individual value.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.