Find duplicate characters in a string

In this program, we will take a string as input and find duplicate characters in a string

Steps to solve the program
  1. Take a string as input and create an empty list.
  2. Use for loop to iterate over every character of the string.
  3. Count the occurrences of each character in the string using count().
  4. If count > 1 then add that character to the empty list.
  5. Convert that list to a set.
  6. Print output

Output :

remove punctuations from a string

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

Leave a Comment