Course Content

Course Content


Data can be expressed in the form of a range using Ruby Ranges (in other words a data set with start and end values and a logical sequence of values in between). Numbers, characters, strings, and objects can all be used as range values.

The range operators ".." and "..." are used by Ruby to produce these sequences. The two-dot form provides a range that is inclusive, but the three-dot form creates a range that is exclusive of the provided high value.

The range() function returns a number series that starts at 0 and increments by 1 (by default) before stopping at a specified value.

In contrast to xrange(), the range() method returns a list or sequence of numbers and requires more memory. When compared to a list or tuple, the range() method consumes less memory regardless of the range it covers because it simply keeps the start, stop, and step values.

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere