初心者向けのPythonのプログラミング問題です。入門編としてチャレンジしてください。Pythonの正答例は以下になります。
問題382
string = “hello”
print(string[::-1]) # “olleh”
問題383
numbers = [1, 2, 3]
tripled = [x * 3 for x in numbers]
print(tripled)
問題384
words = [“apple”, “banana”, “cherry”]
lengths = [len(word) for word in words]
print(lengths)



コメント