Split a string on last occurrence of delimiter. 

In this program, we will take a string as input and split a string on last occurrence of delimiter.

Steps to solve the program
  1. Take a string as input.
  2. Split the string on the last occurrence of delimiter using rsplit().
  3. Print the output.
				
					#Input string
str1 = "l,e,a,r,n,I,n,g,p,y,t,h,o,n"

#Printing output
print(str1.rsplit(',', 1))
				
			

Output :

				
					['l,e,a,r,n,I,n,g,p,y,t,h,o', 'n']
				
			

count and display the vowels in a string

find the first repeated word in a given string. 

Leave a Comment