Advertisement
ganiyuisholaafeez

Untitled

Feb 22nd, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. def cleanup(list_of_strings):
  2.     if " " in list_of_strings:
  3.         list_of_strings.remove(" ")
  4.         return " ".join(list_of_strings)
  5.  
  6. print(cleanup(["cat", "er", "pillar"]))
  7. print(cleanup(["cat", " ", "er", "", "pillar"]))
  8. print(cleanup(["", " ", ""]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement