# importing RegEx module
      import re
      # take list
      my_list = ['@know*', 'pr#ogra!m^', '(py_th@on_3}']
      # using regular expression to remove special characters
      out_list = [re.sub(r'[^a-zA-Z0-9]','',string) for string in my_list]
      # print list without special characters
      print('List after removal of special characters:', out_list)
      
      Python language logo

      special elimination

      beginner
      DSA
      logic
      ...

      Python program to remove all special characters from list

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.