How to correctly define a function?

前端 未结 6 1809
情歌与酒
情歌与酒 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:42

    The result of function call count_letters(word) is not assignable. That's as easy as that.

    I don't believe it can work in python though, you should have an error like that:

    SyntaxError: can't assign to function call
    

提交回复
热议问题