python基础-day02

1.算数运算符

   1+2,1-2,1*2

   5/2     除法

   5//2  整除

   5%2  取余

   5**2 指数

2. 比较运算符>,<,<=,>=,!=

    True 真 真确的  

    False 假,错误的

    例如:if b<a<d:

                    print("true");

扫描二维码关注公众号,回复: 1675421 查看本文章

3.赋值运算符 =,+=,-=,*=,/=, //=,%=

4.逻辑运算符

   表达式1 and 表达式2  and并且,表达式1和表达式2都为真,则为真

   表达式1 or 表达式2 or 或者、或,表达式1和表达式2有一个为真,则为真。

   not 3>2 ==false

   not 3<2 ==true

5.print()默认不可见的 ,end的默认值是换行的

    print("hello world",end="_");\ 

    print("hello world",end="_");\

   输出结果:hello world _ hello world _


作业:99乘法表。

   

猜你喜欢

转载自blog.csdn.net/jianghai_csdn/article/details/80604628