zoukankan      html  css  js  c++  java
  • Python基础总结

    1、Python的发展历史 

        龟叔 Guido van Rossum  1989年在圣诞节期间诞生

        其特点:简单、明确、优雅

        Python是解释型语言  是编译型语言

    2、Python的基本数据类型

        布尔型 True False

        数值型 int float

            单目运算符 + - ~

            算术运算符 ** / * // % + -

            位运算符 & | ^ >> <<

            关系运算符 > >= < <= == !=

            赋值运算符 = += -+ *= /+ **= %= //=

            身份运算符 is    is not

            成员运算符 in     not in

            逻辑运算符 not and or

        所用到的函数

            int()    pow()     divmod()    abs()

        字符串(单引,双引,三引)

            字符串可以进行 + 或 *N 或 in 或 not in 

            索引  s[index] 注:0 <= index <len(s) 或 -len(s) <=index <= -1

            切片  s[start:end:step]   注:start<= index < end

        所用到的函数

            len()  max()  min()  .index()  .count()

            .format() 注:三种使用的方法  N1 = nihao 

                           N2 = hello

                              print("{  }".format(  ))

                              print("{1}{0}".format(N1,N2))

                              print("{new1}{new2}".format(new1=N,new2=N2))

    3、输入和输出

        input()

        print()

    4、if 条件语句

    5、for 循环和 while 循环

    6、break 语句和 continue 语句

        

         

  • 相关阅读:
    PHP 动态执行
    jenkins 'cordova' command not recognised on Jenkins Windows slave
    ionic3 实现扫码功能
    解决ionic3 android 运行出现Application Error
    解决添加codova plugin 编译出现问题:Execution failed for task ':processDebugManifest'.
    菜鸟的 Sass 学习笔记
    解决关于ios访问相机闪退问题
    解决ios关于:ERROR Internal navigation rejected
    Angular4 组件通讯方法大全
    ASP.NET MVC5 使用MiniProfiler 监控MVC性能
  • 原文地址:https://www.cnblogs.com/Qingxiaoyu/p/10066580.html
Copyright © 2011-2022 走看看