+ 2
What can I do to not save whitespace in the list?
Just save word https://code.sololearn.com/c82NbwvcJQWe/?ref=app
5 Respuestas
+ 9
i think you need something like this:
x= ''.join(input('input text: ').split())
print(x)
+ 2
That's right, but if someone wants to write this method , what should he do? I would like to learn
+ 1
Do you want to split the string into a list? Just use the split method.
+ 1
x=input('input text')
list1=[]
b=""
for i in x:
if i!=" ":
b+=i
list1.append(b)
print(list1)
0
Of course, it does not run well on my sololern