Python program to sort the string

In this program, we will take a string as input and sort the string.

Steps to solve the program
  1. Take a string as input.
  2. Sort the string using sorted().
  3. Print the output.
				
					#Input string
string="xyabkmp"

#Printing output
print("".join(sorted(string)))
				
			

Output :

				
					'abkmpxy'
				
			

check whether the string is a subset of another string or not

generate a random binary string of a given length.

Leave a Comment