初心者向けのPythonのプログラミング問題です。入門編としてチャレンジしてください。Pythonの正答例は以下になります。
問題364
person = “name”: “Taro”, “age”: 25
print(person.get(“name”))
問題365
string = “hello world”
print(string.count(“o”)) # 2
問題366
from collections import Counter
numbers = [1, 2, 2, 3, 3, 3]
counter = Counter(numbers)
most_common = counter.most_common(1)[0][0]
print(most_common) # 3



コメント