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