0Pricing
Ruby Academy · Lesson

Logical and Comparison Operators

Learn how to use logical (&&, ||, !) and comparison (==, !=, >, <) operators in Ruby programs.

1

Logical and Comparison Operators

Logical and comparison operators help you make decisions in Ruby programs.

In this lesson, you will learn how to use ==, !=, >, <, &&, ||, and ! operators.

Logical and Comparison Operators — illustration 1

2

Comparison Operators

Comparison operators are used to compare values.

puts 10 == 10  # true
puts 10 != 5   # true
puts 10 > 5    # true
puts 10 < 5    # false

All lessons in this course

  1. Conditional Statements
  2. Loops and Iterators
  3. Logical and Comparison Operators
← Back to Ruby Academy