In this program, we will take a list of strings as input and remove empty spaces from a list of strings.
Steps to solve the program
- Take a list of strings as input.
- Create an empty list.
- Add every string from the input list to the empty list except empty spaces.
- Print the output.
#Input lists
List1 = ["Python", " ", " ","sqatools"]
List2 = []
for string in List1:
if string != " ":
List2.append(string)
#Printing output
print(List2)
Output :
['Python', 'sqatools']