• +91 9723535972
  • info@interviewmaterial.com

Ruby Interview Questions and Answers

Question - Explain Ruby ranges. What are the ways to define ranges?

Answer -

Ruby range represents a set of values with a beginning and an end. They can be constructed using s..e and s...e literals or with ::new.

The ranges which has .. in them, run from beginning to end inclusively. The ranges which has ... in them, run exclusively the end value.

Ruby has a variety of ways to define ranges.

  • Ranges as sequences
  • Ranges as conditions
  • Ranges as intervals

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners