用python写一段代码,完成题目:输入一段英文,输出这段英文中所有长度为3个字母的单词
时间: 2024-05-16 10:12:07 浏览: 14
Sure, here's the code:
```
text = input("Please enter some English text: ")
words = text.split()
three_letter_words = [word for word in words if len(word) == 3]
print("The three-letter words in the text are: ")
for word in three_letter_words:
print(word)
```
You can copy and paste this code into a Python IDE or a text editor and run it. It will prompt you to enter some English text, and then it will print out all the three-letter words in that text. I hope this helps!