Question 1 of 25
Hints left: 3
Q1
What is the result of the expression `"hello".split` in Ruby?
Q2
What does the `split` method do when called on a string in Ruby?
Q3
Which of the following methods is used to check if a key exists in a hash in Ruby?
Q4
What is the output of the given code? string_array = ["a","e","i","o","u"] print string_array[3]
Q5
Which of the following methods is used to remove a key-value pair from a hash in Ruby?
Q6
What is the result of the expression `"hello".length` in Ruby?
Q7
What does the '<<' operator do when used with arrays in Ruby?
Q8
What does the `include?` method do when used with strings in Ruby?
Q9
What method in Ruby is used to join the elements of an array into a single string?
Q10
What does the `each_key` method do when called on a hash in Ruby?
Q11
In Ruby, which symbol is used to access the value associated with a key in a hash?
Q12
What does the `reverse` method do when called on a string in Ruby?
Q13
In Ruby, what does the `capitalize` method do when used with strings?
Q14
In Ruby, which method is used to convert a string to uppercase?
Q15
In Ruby, which method is used to add a key-value pair to a hash?
Q16
Which method in Ruby is used to add an element to the end of an array?
Q17
Which method in Ruby is used to check if a key exists in a hash?
Q18
What is the output of the given code? string_array = ["a","e","i","o","u"] boolean_array = ["True","False"] puts string_array[3] puts boolean_array[1]
Q19
What does the pop method do when called on an array in Ruby?
Q20
In Ruby, which method is used to concatenate two strings?
Q21
What will be the output of the following? array1 = [1,2,3] array2 = [0,0,0] if array1 >= array2 print "Greater or equal" else print "Not equal" end
Q22
Arrays can be used to store multiple values in one single variable.
Q23
In Ruby, which method is used to remove the last element from an array and return it?
Q24
What does the `chomp` method do when used with strings in Ruby?
Q25
In Ruby, how can you add a key-value pair to an existing hash?