#Assign your variables below, each on its own line!
caesar = "Graham"
praline = "John"
viking = "Teresa"
#Put your variables above this line
print caesar
print praline
print viking
第三节
1 Python是通过\来实现转义字符的
2 练习把'Help! Help! I'm being repressed!' 中的I'm中的'进行转义
#The string below is broken. Fix it using the escape backslash!
'Help! Help! \'\m being repressed!'
第四节
1 我们可以使用""来避免转义字符的出现
2 练习: 把变量fifth_letter设置为MONTY的第五个字符
"""
The string "PYTHON" has six characters,
numbered 0 to 5, as shown below:
+---+---+---+---+---+---+
| P | Y | T | H | O | N |
+---+---+---+---+---+---+
0 1 2 3 4 5
So if you wanted "Y", you could just type
"PYTHON"[1] (always start counting from 0!)
"""
fifth_letter = "MONTY"[4]
print fifth_letter
"""Assign the string "Ping!" to
the variable the_machine_goes on
line 5, then print it out on line 6!"""
the_machine_goes = "Ping!"
print the_machine_goes