cara menghapus spasi dalam string di python
sentence = ' hello apple '
sentence.strip()
>>> 'hello apple'
Light Lemur
sentence = ' hello apple '
sentence.strip()
>>> 'hello apple'
# Python3 code to remove whitespace
def remove(string):
return string.replace(" ", "")
# Driver Program
string = ' g e e k '
print(remove(string))