2. 从键盘上输入一个字符串”I am a student, and you are a teacher. “,然后 (3)把这些单词排序输出

我第三问不会
求求大佬,告诉我代码怎么编?

没有完全理解题意啊

import re
text = input("请输入内容\n")
text_list = text.replace('\.','').split(' ')
print(text_list)
text_list.sort()
print(text_list)

img

使用split切分,然后sort,sorted随便选一个。不懂就去百度python split . sort sorted的作用,