Re: How to replace space in a string with \n

^Bart gabriele1NOSPAM at hotmail.com
Thu Jan 31 05:43:36 EST 2019


> Have you even tried to run this?

No, it doesn't run, it's just a personal idea! :)

> I don't think this does what you think it does.
> 
> text.count(' ') will return 5, an integer. So you are testing if 5 is in text. But since
> 5 is an integer that will raise a TypeError.

Yes, I understood this is wrong!

>> rightText = text-space
> 
> 
> Where does text-space come from?

I thought to use (text) - (space), space is " " but I should replace in 
text what I said in the variable is space.

I know there are a lot o solutions but this afternoon I'll ask to the 
teacher what we should do to do it!

Thank you very much for your reply! :)
^Bart



More information about the Python-list mailing list