如何用python最后两个单词打印()形成带空格的句子?比如“Hello world, there are 200 pcs”,我需要打印:“200 pcs”。太感谢了。
sentence = "Hello world, there is 200 pcs"
what_I_need = sentence.split()
what_I_need[-3]
# That prints "is"
print(what_I_need)
# But I need to print "is 200 pcs"
大话西游666
紫衣仙女
慕勒3428872
相关分类