In this program, we will take a string as input and find words greater than the given length.
Steps to solve the program
- Take a string as input.
- Split the given string using split().
- Find the words having lengths greater than 3 from the splitter string using For loop.
- Print the output.
#Input string
string = "We are learning python"
for word in string.split(" "):
if len(word) > 3:
print(word,end=" ")
Output :
learning python