[Tutor] help on raw_input()
alan.gauld at btinternet.com
Sat Apr 14 09:36:00 CEST 2007
"ammar azif" <ceasar102 at yahoo.com> wrote
> i wanted to get a string from raw_input like this
OK, Can you explain precisely what you want the string to contain.
\n is the string representation of a newline. Do you want to enter
something that starts with two newlines? Or do you literally want
the sequence \,n,\,n?
If its the latter thats what Python has stored. The double slash
is only there when python displays the result (Try using len and
comparing if you aren't convinced)
If you want to actually capture newline characters from raw_input,
thats more tricky. But before we get to that can you clarify what
you actually want?
More information about the Tutor