Control Flow in Ruby- Boolean_3: Why is it true not false?


#1


https://www.codecademy.com/courses/ruby-beginner-en-NFCZ7/2/1?curriculum_id=5059f8619189a5000201fbcb

Just curious as to why boolean_3 is true. Wouldn't 2**3==8 && 3**2=9 evaluate to 6==8 && 6==9 making it false? Can anyone explain why its true and not false?

# boolean_1 = 77 < 78 && 77 < 77
boolean_1 = false

# boolean_2 = true && 100 >= 100
boolean_2 = true

# boolean_3 = 2**3 == 8 && 3**2 == 9
boolean_3 = true


#2

It is not 2 times 3 but two to the third, and likewise not 3 times 2, but three squared. Big difference in the outcomes.


#3

thank you for clearing this up!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.