May-29-2020, 01:32 PM
you are feeding us info with a spoon. describe the broad picture so that we can help you in best possible way.
obviously you reading this from a file and as I said there may be better way to deal with it.
as to removing new line at the end - one way is to use
as to raw string - raw strings are not a different kind of string. They are a different way of describing a string in your source code. i.e. raw strings apply only to string literals. they exist so that you can more conveniently express strings that would be modified by escape sequence processing
obviously you reading this from a file and as I said there may be better way to deal with it.
as to removing new line at the end - one way is to use
str.strip()
method (similiar to str.split()
)as to raw string - raw strings are not a different kind of string. They are a different way of describing a string in your source code. i.e. raw strings apply only to string literals. they exist so that you can more conveniently express strings that would be modified by escape sequence processing
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs