[Tutor] green brackets?
rabidpoobear at gmail.com
Wed Jul 11 22:55:42 CEST 2007
elis aeris wrote:
> def mousemove(x,y):
n\ and \n are different.
n\ means "an n character and then an escaped character"
because the n\ was followed by a ", then the string literally contains n\"
"my momma always said \"life is like a box of chocolates. you never know
what you gonna get.\""
will be the following string:
my momma always said "life is like a box of chocolates. you never know
what you gonna get."
The reason they're "green" in IDLE is because there is no end " for the
string, since the \" is interpreted as "put the quotation mark into the
of stopping the string here"
> f.write("command" + " =" + " mousemove\n")
> f.write("parameter_1 = " + str(x) + "\n")
> f.write("parameter_2 = " + str(y) + "\n")
> for some reason that last bracket of the 2nd and last line line in
> IDLE are green.\
> why is that?
More information about the Tutor