zoukankan      html  css  js  c++  java
  • python day01总结

    一 、python历史背景

      1、创始人:Guido van rossum     龟叔

      2、创始时间:1989年

      3、特点:简单,明确, 优雅

      4、解释型语言,高级语言

    二、Python的基本数据类型

      1、布尔类型    True    False

        

    print (10 > 5)

    输出  True

    print ( 10 >  20 )

    输出 False

      2、数值类型      int (155)    float(30.55)

        (1)、单目运算符:~  +  - (正负)

        (2)、算术运算符:**  , /  , *   , //  , %  , +  , -

        (3)、位运算符:  &  , | ,  ^  , >> ,  <<
        (4)、关系运算符: > >=  , < <= ,  ==  , !=
        (5)、赋值运算符: = ,  += ,  -=  , /= ,  *=  , //= ,  %= ,  **=
        (6)、身份运算符 : is  , is not
        (7)、成员运算符 : in ,  not in
        (8)、逻辑运算符: not ,  and ,  or

      3、函数:

        (1)、int()

        (2)、pow()

        (3)、divmod()

        (4)、abs()

      字符串

        str    :'  '  ,  "   "   ,  ' ' '     ' ' '     , " " "      " " " 

        运算符: + , / , *n , in  ,  not  in 

        有序的     索引(0)    "abc"     index   :索引

          s[index]   0<= index <len(s) - len(s) <= index <= -1

        切片:

          s[start :end : step]

            start <= index < end ---------> index +=step

        函数:

          len():求字符串长度

          max():最大值

          min():最小值

          . index():索引

          . count():统计

          . format() :   %s  字符串     ,   %d  数值      ,  %f   浮点

    三、读入和输出

      input()  :   读入

          age  =  int(input("请输入年龄:"))

      print()    :     输出

           

    print (  3+4)
  • 相关阅读:
    sdk 和 Open API 有什么区别
    分布式锁介绍
    K8s 资源更新机制详解 (ResourceVersion 与 patch)
    Pod 一直处于pending状态但是kubectl describe和logs都没有输出信息的原因
    CAP 理论详解
    kubebuilder中的controller:latest是什么镜像
    Codeforces Round #441 (Div. 1, by Moscow Team Olympiad)
    Matrix Tree 定理及证明
    Codeforces Global Round 15 题解
    Harbour.Space Scholarship Contest 2021-2022 (Div. 1 + Div. 2) 题解
  • 原文地址:https://www.cnblogs.com/youmeishaoye/p/10066262.html
Copyright © 2011-2022 走看看