题解 | #字符串最后一个单词的长度#
字符串最后一个单词的长度
http://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
message = input('') message = message[::-1] j = 0 for i in message:
if i != ' ':
j = j + 1
else:
break
print(j)
字符串最后一个单词的长度
http://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
message = input('') message = message[::-1] j = 0 for i in message:
if i != ' ':
j = j + 1
else:
break
print(j)
相关推荐