三月七
Python 读入整数
input() 输入字符串
split() 输入按照空格拆分字符串
map() 多个元素分别映射
1 a,b = map(int,input().split()) 2 print(a + b) 3 //输入输出 4 20 15 5 35
a/b 除法;a//b 整除,没有小数点;a%b 取余运算;a **2 幂运算
在 Python 循环中,只有在 def 中才能使用 return 跳出循环
逻辑运算
与运算 and 或运算 or 非运算 not
对应C++中的 &&, ||, !
列表删除元素
pop() 默认删除末尾元素
remove()
del 关键字
列表方法
count() 统计元素出现次数
index() 返回元素第一次出现位置
元组