Calculate the length of string

In this program, we will take a string as input and calculate the length of string.

Steps to solve the program
  1. Take a string as input.
  2. Use the in-built len function to calculate the length of the string.
  3. Prin the output.
				
					#Input string
string="python"

#Printing output
print(len(string))
				
			

Output :

				
					6
				
			

reverse the words in a string.

calculate the frequency of each character in a string.

Leave a Comment