MathPython
English
© Rollpie
文字列の count 関数を使うと、文字列に含まれる単語(部分文字列)をカウントできます。
text = "東京 大阪 名古屋 東京 福岡 東京" count = text.count("東京") print(count) # 3