Python程序设计基础教材配套课件第1章 Python语言基础.pptx
Python概述;程序;Python程序设计语言;AI(人工智能)
Blockchain(区块链)
CloudCompute(云计算)
BigData(大数据)
EdgeComputer(边缘计算);;;;;;;人机交互;输出
=1;表达式语句;print(*objects);print(*objects,sep=,);print(*objects,sep=,end=\n)
;print(*objects,sep=,end=\n)
;print(*objects,sep=,end=\n)
;print(*objects,sep=,end=\n,file=sys.stdout)
;1.str.format()方法;1.str.format()方法;1.str.format()方法;1.str.format()方法;1.str.format()方法;a=5
b=3;“:.mf”控制输出浮点数小数点后m位数字;3.字符串拼接:用+将多个字符串拼接为一个字符串;a=input();;对象与变量;classint整型;classint整型;变量名是给对象贴一个用于访问的标签
给对象绑定名字的过程也称为赋值
赋值符号“=”;变量与赋值:=;;;a=100;a=100;a=100;a=100;多变量同步赋值;多变量同步赋值;多变量同步赋值;多变量同步赋值;多变量同步赋值应用:交换变量的值;变量命名规范;变量命名规范;变量命名规范;变量命名规范;Falseawaitelseimportpass
Nonebreakexceptinraise
Trueclassfinallyisreturn
andcontinueforlambdatry
asdeffromnonlocalwhile
assertdelglobalnotwith
asyncelififoryield;;sum=0
foriinrange(101):
sum=sum+i
print(sum)#正常输出5050;编码与命名规范;编码规范PEP8;编码规范PEP8;编码规范PEP8;编码规范PEP8;编码规范PEP8;编码规范PEP8;命名规范;注释;注释;单行注释;文档注释;注释;注释