Mega Code Archive
Categories
/
Ruby
/
Language Basics
Chaining together multiple comparisons is also possible with a clever use of parentheses
age = 24 gender = "male" puts "You're a working age man" if gender == "male" && (age >= 18 && age <= 65)