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)
  • 相关阅读:
    Problem: 数字的拆分之二
    Problem: 数字的拆分之一
    Problem : [Usaco2014 Dec]Piggy Back
    Problem: 八中厕所的门
    Problem : [Usaco2007 Open]Catch That Cow 抓住那只牛
    vim设置
    生活致富靠传销?北海警方:排版错误已整改
    SpringBoot(二)——配置文件
    SpringBoot(一)——IDEA创建项目
    Redis(一)——安装与使用
  • 原文地址:https://www.cnblogs.com/youmeishaoye/p/10066262.html
Copyright © 2011-2022 走看看