Python | Remove spaces from a string - GeeksforGeeks

PHOTO EMBED

Wed Dec 28 2022 01:17:34 GMT+0000 (Coordinated Universal Time)

Saved by @Mostafa_malmir

# Python3 code to remove whitespace
def remove(string):
    return string.replace(" ", "")
     
# Driver Program
string = ' g e e k '
print(remove(string))
content_copyCOPY

https://www.geeksforgeeks.org/python-remove-spaces-from-a-string/