初心者向けのPythonのプログラミング問題です。入門編としてチャレンジしてください。Pythonの正答例は以下になります。
問題337
words = [“hello”, “world”, “python”]
reversed_words = [word[::-1] for word in words]
print(reversed_words)
問題338
string = ” hello world ”
cleaned_string = string.strip()
print(cleaned_string)
問題339
numbers = [1, 2, 3, 4, 5]
average = sum(numbers) / len(numbers)
print(average)



コメント