removing empty element in a list
Python
num = ["Hello", 34, 45, " ", 40]
for i in num:
if i != " ":
print(i, end = " ")
#or
num1 = ["Hello", 34, 45, " ", 40]
num1.remove(" ")
print('\n')
print(num1)
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.