11Python的注释是通过“#”来实现的,并不影响代码的实现
2 练习:给下面的代码加上一行注释
[python]
#this is a comments for Python
mysterious_variable = 42
12 Python的多行注释是通过“ """ """ ”来实现的
2 练习:把下面的代码加上多行
[python]
"""
this is a Python course
"""
a = 5
13 Python有6种算术运算符+,-,*,/,**(幂),%
2 练习:把变量count_to设置为1+2
[python]
#Set count_to equal to 1 plus 2 on line 3!
count_to = 1+2
print count_to
14 Python里面求x^m,写成x**m
2 练习:利用幂运算,把eggs的值设置为100
[python]
#Set eggs equal to 100 using exponentiation on line 3!
eggs = 10**2
print eggs
1 练习:
1 写一行注释
2 把变量monty设置为True
3 把变量python值设置为1.234
4 把monty_python的值设置为python的平方
[python]
#this is a Python
monty = True
python = 1.234
monty_python = python**2