#coding =utf-8
Print "Let ' s practice everything."
print ' you\ ' d need to know\ ' bout escapes with \ \ Do \ n newlines and \ t tabs. '
Poem = "" "
\tthe Lovely World
With logic so firmly planted
Cannot discern \ n the needs of Love
Nor comprehend passion from intuition
and requires an explanation
\n\twhere there is none.
"""
Print "----------------"
Print Poem
Print "----------------"
five = 10-2 + 3-6
Print "This should is five:%s"% five
Def Secret_formula (started):
Jelly_beans = started * 500
Jars = jelly_beans/1000
Crates = jars/100
Return Jelly_beans, Jars, crates
Start_point = 10000
Beans, jars, crates = Secret_formula (start_point) #函数内部的变量都是临时的, when your function returns, the return value can be assigned to a variable----"You can create a new variable to hold the return value of the function.
Print "With a starting point of:%d"% start_point
Print "We ' d has%d beans,%d jars, and%d crates."% (beans, jars, crates)
Start_point = START_POINT/10
Print "We can also do the This"
Print "We ' d has%d beans,%d jars,%d crates."% Secret_formula (start_point)
The python--function internal variables are temporary, and when the function returns, the return value can be assigned to a variable.