R
R
roma_nikita2020-04-23 16:43:17
Python
roma_nikita, 2020-04-23 16:43:17

How to remove all spaces from file document?

It is not necessary to remove spaces from the file variable from the file, for example

f = open('text.txt','w')
print('answer is: '+f.read.split() # но split не работает на массивах

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Miit, 2020-04-23
@roma_nikita

replace to help

' string string '.replace(' ' , '')
# 'stringstring'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question