Answers for "remove whitespace py"

11

python delete white spaces

sentence = ' hello  apple'
sentence.strip()
>>> 'hello  apple'
Posted by: Guest on May-08-2020
0

how to remove whitespace from string in python

def remove_witespace(data_of_string):
    string = ""
    for char in data_of_string:
        if " " not in char:
            string = string + char
            
    return string
print(remove_witespace("python is amazing programming language"))
Posted by: Guest on December-22-2021

Python Answers by Framework

Browse Popular Code Answers by Language