# take list
      my_list = ['Know Program', '', 'Python', 'C', '', 'Java']
      # printing original list
      print('List:', my_list)
      # remove empty string using native method
      new_list = []
      for i in my_list:
          if (i):
              new_list.append(i)
      # printing list without empty string
      print('New List:', new_list)
      
      Python language logo

      Empty Removal

      beginner
      list
      DSA

      Python program to remove empty strings from a list

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.