Test your proficiency in Ruby.
. . . Please leave your comments. . .
Best of luck!
*** Ary Alva ***
Integers
Floats
Characters
Any type
Strings
Rate this question:
10
A Ruby array has no fixed size
Count
None of the above
Rate this question:
1
0
-1
None of the above
Rate this question:
Puts a[0..5]
A=[0,1,2,3,5] puts a[0..5]
Print a[1..5]
For count in a print a[count] end
None of the above
Rate this question:
A[2]
Puts a[3]
For count in a print count if count ==2 end
For count in a print a[2] end
Rate this question:
Hash indices can be of any type
There is no difference
The size of a hash is not fixed
The hash size is incremented dynamically
None of the above
Rate this question:
Index
Value
Entry
Parameter
None of the above
Rate this question:
H=[fish => Catfish, dog => Terrier, cat => Siamese]
H={fish => Catfish, dog => Terrier, cat => Siamese}
H=[fish - Catfish, dog - Terrier, cat - Siamese]
H=[fish => Catfish dog => Terrier cat => Siamese]
None of the above
Rate this question:
H[1]
H[2]
H[dog]
H['dog']
H["dog"]
Rate this question:
For animal in h puts animal end puts h['cat']
For animal, type in h puts "I love " + type + " " +animal +"s" end puts h['cat']
For count in h puts "I love " + type + " " +animal +"s" end puts h['cat']
For h in h puts h end
For h in h puts h end puts h['cat']
Rate this question:
AryAlva
Ary Alva
Nothing
Ary Alva
None of the above
Rate this question:
Par1 par3
Par1 #{par2} par3
Par1 par2 par3
No output
None of the above
Rate this question:
Enough already!
Roar
Bark
Trumpet
None of the above
Rate this question:
Putting square braces before the first statement and after the last statement of the snippet of code turns it into a block.
Making a method out of snippet of code turns it into a block.
Putting the word "do" at the beginning of the first statement and the word "end" after the last statement of the snippet of code turns it into a block.
Putting curly braces before the first statement and after the last statement of the snippet of code turns it into a block.
None of the above
Rate this question:
Block parameters are located at the beginning of the block, enclosed in a pipe symbols (||) and are separated by a colon.
Block parameters are located at the beginning of the block, enclosed in a pipe symbols (||) and are separated by space.
Block parameters are located at the beginning of the block, enclosed in square brackets and are separated by semicolon.
Block parameters are located at the beginning of the block and separated by semicolon.
None of the above
Rate this question:
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.