Introduction Flashcards
1
Q
Write the three data types of ruby, and print the value out.
A
my_age = 18 my_boolean = true my_name = ‘Scott’
puts my_age
puts my_boolean
puts my_name
2
Q
Do the following three things:
- Print out your name so it’s backwards
- Print out your name so it’s all uppercase
- Print out your name so it’s all lowercase
A
puts ‘Scott’.reverse
puts ‘Scott’.upcase
puts ‘Scott’.downcase
3
Q
How do you write a single-line comment and how about a multi-line comment?
A
Don’t lose your focus now!
=begin
One comment
Two comment
=end