1.
文字列"Hello World"のスペースを削除して"HelloWorld"とするために使用するメソッドはどれですか?
2.
文字列フォーマットのf-string(フォーマット文字列)の記述方法として正しいものはどれですか?
3.
文字列の結合にjoin()メソッドを使用する場合、リスト["apple", "banana", "cherry"]をカンマ区切りの文字列にする正しいコードはどれですか?
4.
次のコードを実行した場合の出力は何ですか?
items = ["apple", "banana", "cherry"]
output = " - ".join(items)
print(output)
5.
次のうち、文字列の結合に使われないメソッドはどれですか?
6.
リスト["Python", "Java", "C++"]を結合して"Python and Java and C++"とするためのコードはどれですか?
7.
次のうち、文字列"Hello"を5回繰り返した文字列を生成するためのコードはどれですか?
8.
次のコードの出力結果を求めてください。
text = "Welcome"
repeat_text = text * 3
print(repeat_text)
9.
次のコードを実行した場合の出力は何ですか?
a = "Python"
b = "Programming"
result = a + " " + b
print(result)
10.
変数greeting = "Hello"とname = "Alice"を使って、「Hello, Alice!」と出力するためのコードはどれですか?
11.
次のコードの出力結果を求めてください。
words = ["data", "science", "python"]
sentence = " ".join(words)
print(sentence)
12.
変数first = "Hello"とsecond = "World"を使って、「Hello, World!」という文字列を生成するために適切なコードはどれですか?
13.
次のコードの出力結果を求めてください。
names = ["John", "Paul", "George", "Ringo"]
result = ", ".join(names)
print(result)
14.
"Python3"という文字列から「3」を削除して"Python"にするコードはどれですか?
15.
変数name = "Alice"とage = 25の内容を使って「Alice is 25 years old」という文字列を生成するために入力すべきコードはどれですか?
16.
次のコードの出力結果を求めてください。
text = "Python"
result = text + " " + text[::-1]
print(result)
17.
Pythonで文字列を結合するために使用される演算子はどれですか?
18.
変数animal = "cat"とsound = "meow"を使って、「The cat says meow」という文字列を生成するために入力すべきコードはどれですか?
19.
次のコードの出力結果を求めてください。
text = "Hello"
result = text + " " * 3 + "World"
print(result)
20.
次のリスト["one", "two", "three"]をスペース区切りで結合し、"one two three"という文字列を生成するコードはどれですか?