Add ly at the end if the string ends with ing.

In this program, we will take a string as input and add ly at the end if the string ends with ing.

  1. Take a string as input.
  2. Check whether the string ends with ‘ing‘.
  3. If yes, then add ‘ly‘ at the end.
  4. Print the output.
				
					#Input string
str1 = "winning"

#Printing output
if str1[-3:] == "ing":
    print(str1+"ly")
				
			

Output :

				
					winningly
				
			

 add ‘ing’ at the end of the string

reverse words in a string

Leave a Comment