题解 | #字符串最后一个单词的长度#
字符串最后一个单词的长度
https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
string = input() words=string.split() print(len(words[-1]))
变量
string : 存放输入的内容
words : 数组存放string中的每一个单词
len() : 计算单词的长度
#打卡计划#字符串最后一个单词的长度
https://www.nowcoder.com/practice/8c949ea5f36f422594b306a2300315da
string = input() words=string.split() print(len(words[-1]))
string : 存放输入的内容
words : 数组存放string中的每一个单词
len() : 计算单词的长度
#打卡计划#相关推荐
招聘动态