初心者向けのPythonのプログラミング問題です。入門編としてチャレンジしてください。Pythonの正答例は以下になります。
問題325
numbers = [1, 2, 3, 4, 5]
print(sum(numbers))
問題326
string = “hello world hello”
word = “hello”
count = string.split().count(word)
print(count)
問題327
keys = [“name”, “age”]
values = [“Alice”, 30]
dictionary = dict(zip(keys, values))
print(dictionary)



コメント