TQC+ 程式語言 Python 3 _ 803 倒數三個詞

說明:
請撰寫一程式,讓使用者輸入一個句子(至少有五個詞,以空白隔開),並輸出該句子倒數三個詞。
範例輸入:
Many foreign students study in FJU
範例輸出:
study in FJU
程式碼:
strLi = input().split(' ')

print(strLi[-3],strLi[-2],strLi[-1])

沒有留言:

張貼留言