LoginSignup
9
8

More than 5 years have passed since last update.

新人研修課題

Posted at

1.
Assign the variable x to the value 5.

2.
What is the datatype of "Matt"?

3.
x = 5
Is x a string?

4.
What does this expression evaluate to?
"Cool".+("io")

5.
What does this expression evaluate to?
"bob" + 42

6.
a = "Bat"
b = "woman"
What does this expression evaluate to?
a + b

7.
What does this expression print?
my_name = "50 Cent"
my_name = "Miley"
p my_name

8.
rapper = "Jaydakiss"
Get the first letter from the string "Jaydakiss".

9.
Get the first through 3rd elements from the "Jaydakiss" string.

10.
Replace the "l" in the following string with "m":
word = "lace"

11.
Assign the variable my_dawg to the value "DMX"

12.
What does the following expression evaluate to?
"Dead Poet" = fav_bar

13.
What does the following expression print?

something = "cats"
crazy = something
puts crazy

14.
What does the following expression evaluate to?
3 + 4

15.
What does the following expression evaluate to?
4 * 7

16.
What does the following expression evaluate to?
2 ** 3

17.
What does the following expression evaluate to?
8 / 2

18.
What does the following expression evaluate to?
3 / 2

19.
What does the following expression evaluate to?
3.0 / 2.0

20.
What does the following expression evaluate to?
"i am not shouting".upcase()

21.
Convert every letter of "YoLo BrAh" to lowercase.
nice = "YoLo BrAh"

22.
Concatenate the following strings:
first = "Beautiful "
second = "face tattoo"

23.
Integers have useful built-in methods too. Convert the number 5 to the string "5".

24.
5.to_s
to_s stands for "to string"
What is the problem with the following code?
my variable = "Mr. White"

25.
Update the code, so it can run successfully:
band = "Blink" + 182

9
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
8