Stripping in Python
ronnyma at transfinite.no
ronnyma at transfinite.no
Thu Jan 15 07:03:29 EST 2015
On Thursday, January 15, 2015 at 11:35:11 AM UTC+1, Abdul Abdul wrote:
> Hello,
>
> I have a program where I read a line input from the keyboard.
>
> If I remove this portion of code after reading the line, I get an error:
>
> line = line.rstrip()
>
> Why is that? Should stripping be always be used after reading an input in Python?
>
> Thanks.
You have a displaced apostrophe in line 8 of your code. Sorry for the joke, but like Peter Otten says, you need to include more code, Python-version and the error message to prove us with context so that we can help you.
Best regards,
Ronny Mandal
More information about the Python-list
mailing list