Pythonで歌詞の単語数をカウントする方法
split()メソッドを使用する方法:lyrics = "City of stars, are you shining just for me?" word_count = len(lyrics.split()) print("歌詞の単語数:", word_count)>>More
split()メソッドを使用する方法:lyrics = "City of stars, are you shining just for me?" word_count = len(lyrics.split()) print("歌詞の単語数:", word_count)>>More
まず、以下に「Someone Like You」の歌詞を掲載します(原文のまま表示します):I heard that you're settleddown That you found a girl and you're married now I heard that your dreams came true Guess she gave you things I didn't give to you>>More