github我的刷题 https://github.com/chaor/LeetCode_Python_Accepted | 我翻译的python3.4官网教程 kitt.me/py3
class Solution: # @param s, a string # @return an integer def lengthOfLastWord(self, s): s_split = s.split() return 0 if len(s_split) == 0 else len(s_split[-1])