How to correctly define a function?

前端 未结 6 1814
情歌与酒
情歌与酒 2020-12-21 08:22

In python I\'m trying to do the following to define a function:

count_letters(word) = count_vowels(word) + count_consonants(word)

But for

6条回答
  •  不思量自难忘°
    2020-12-21 08:38

    May be what you want to do is something like

    def count_letters(word):
        return count_vowels(word) + count_consonants(word)
    

提交回复
热议问题