Loops: range() vs xrange()

Published: 27 October 2024
on channel: Truly Coding
9
0

50. Explain the difference between range() and xrange()?

In Python 2, range() returns a list, whereas xrange() returns an iterator. In Python 3, range() behaves like xrange() from Python 2.

#Python #RangeXrange #Loops


Watch video Loops: range() vs xrange() online without registration, duration hours minute second in high quality. This video was added by user Truly Coding 27 October 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9 once and liked it 0 people.