python入门教程 2

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  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值