puthon練習3

# 1.字符串最後一個單詞的長度 題目描述:計算字符串最後一個單詞的長度,單詞以空格隔開。 輸入描述: 一行字符串,非空,長度小於5000。 輸出描述: 整數N,最後一個單詞的長度。 示例1:     輸入:hello world     輸出:5 #!/usr/bin/python #coding:utf-8 str=raw_input("請輸入句子:") strt=str.split() pr
相關文章
相關標籤/搜索