1,python里面的数据类型
a,int型
b,str型
c,list型
d,tuple型
e,set型
f,dict型
import sys
#int
ge=1
print(type(ge))
#字符型
CHAR='c'
print(type(CHAR))
#列表
ll=[10,'name']
print(type(ll))
#元组
d=(1,2,3)
print(type(d))
#集合
collec={10,20,30}
print(type(collec))
#字典
NB={'name':'kk','age':10}
print(type(NB))
2,格式化输出
print()//自带n
占位符
print(f’{name},{age}')试用于python3.6以上
print(‘output text’,end=“n”) print的默认形式
3,标准化输入input,用input输入的函数默认为字符串
4,python里面的强转
5,python里面的算数运算符
6,多变量赋值
eg: a,b,c=10,8,‘str’
7,逻辑运算符
and,or,not
8,条件判断与循环
import sys
name="NB"
age=100
n=10
while n>0:
if n>5:
print(f'{name},{age}')
if n>8:
while age>0:
print(f'{n}')
age-=1
n-=1
str1='hello python'
str2=['123',56]
for i in str1:
print(f'{i}')
for i in str2:
print(f'{i}')
while和else连用
i=10
while i>5:
i-=1
else:
print("finish")
同样for和else也一样



