mardi 21 juin 2016

Ruby Conditionals Mechanism

I'm learning ruby and going through the basics. After playing around with conditionals I've made the following code:

x = 10
z = 10
if x==10 && (puts "wow" if x == z)
  puts "hello"
end

When I run it I got only "wow". Could somebody explain why "hello" is never printed ?

Thank you.

Aucun commentaire:

Enregistrer un commentaire