Explain range() function with the help of an example.
Answers
Answered by
3
Explanation:
In this example, the range() function is generating a sequence from 0 to 4 . The for loop is then using each value generated by range() , one at a time, to access a value from the sampleList . In Python 3, the range() function generates each number in the sequence one at a time.
Similar questions