Find the words greater than the given length.

In this program, we will take a string as input and find words greater than the given length.

Steps to solve the program
  1. Take a string as input.
  2. Split the given string using split().
  3. Find the words having lengths greater than 3 from the splitter string using For loop.
  4. 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
				
			

find the least frequent character in a string.

get the first 4 characters of a string.

Leave a Comment