Write a program in Python allowing to delete multiple spaces in a text file
named myfile.txt which contains a text: T =
'Python is programming language'
f = open("mytext.txt" , "r")
content = f.read()
f.close()
words = content.split()
f = open("mytext.txt" , "w")
for word in words:
f.write(word )
f.close()
Comments
Leave a comment