Ruby - Variables and Data Types
What will be printed by this Ruby code?
val = nil if val.nil? puts "Empty" else puts "Contains value" end
val = nil if val.nil? puts "Empty" else puts "Contains value" end
val.nil? returns true because val is nil.puts "Empty" executes.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions