python常用语句小结_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

切片  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 语句

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值