31. What does the `split` method do when called on a string in Ruby?
32. In Ruby, how can you add a key-value pair to an existing hash?
33. What does the `each_key` method do when called on a hash in Ruby?
34. Which of the following methods is used to check if a key exists in a hash in Ruby?
35. In Ruby, which method is used to convert a string to uppercase?
36. What does the `reverse` method do when called on a string in Ruby?
37. Arrays can be used to store multiple values in one single variable.
38. 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]
string_array = ["a","e","i","o","u"]
boolean_array = ["True","False"]
puts string_array[3]
puts boolean_array[1]
39. 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
array1 = [1,2,3]
array2 = [0,0,0]
if array1 >= array2
print "Greater or equal"
else
print "Not equal"
end
40. What is the output of the given code?
string_array = ["a","e","i","o","u"]
print string_array[3]
string_array = ["a","e","i","o","u"]
print string_array[3]