Python笔记第三周

三月三十日

  • 求一败以内素数
    解法一
    Python笔记第三周
    解法二
    使用了质数列表
    Python笔记第三周
    解法三
    Python笔记第三周
    解法三优化
    Python笔记第三周
    解法四
    Python笔记第三周
  • 孪生素数
    大于三之后,孪生素数只可能是六的倍数的前后值
    孪生素数解法
    Python笔记第三周
  • 杨辉三角
    Python笔记第三周
    解法一优化版
    Python笔记第三周
    解法二
    补零
    Python笔记第三周
    解法三
    对称
    Python笔记第三周
    解法三优化
    Python笔记第三周

三月三十

  • ipython使用
    “?”查询帮助
    “-”之上一次的out值“- -”指上上次的out值
    “-oh”查询输出历史
    “-dh”查询目录历史
    “!”命令
    ”%%timeit“显示代码执行时间详情
    Python笔记第三周
  • 集合set
    集合是可变的、无序的、不重复的
    set()得到空set
    Python笔记第三周
    set后跟可迭代对象
    Python笔记第三周
    集合的得到方法
    Python笔记第三周
  • 集合的性质
    Python笔记第三周
  • 集合增加元素
    add
    增添单个元素
    Python笔记第三周
    (3,4)被去重
    update
    批量添加元素,依次拿出可迭代元素 并且去重
    Python笔记第三周
  • 删除
    remove
    不同于列表,集合中效率极高O1
    Python笔记第三周
    Python笔记第三周
    没有找到报错
    Python笔记第三周
    clear
    Python笔记第三周
    将集合内的元素引用计数清零

pop
Python笔记第三周
in操作符
Python笔记第三周
Python笔记第三周

  • 集合概念
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    并集
    Python笔记第三周
    Python笔记第三周
    交集
    Python笔记第三周
    Python笔记第三周
    差集
    Python笔记第三周
    Python笔记第三周
    对称差集
    Python笔记第三周
    Python笔记第三周
  • 字典
    Python笔记第三周
    空字典
    dict(),dict{}
    字典加入元素的方式
    Python笔记第三周
    Python笔记第三周
    查找
    Python笔记第三周
    没有找到报错
    get
    没有找到不报错,改为添加对应的缺省值,没有写明就为none
    Python笔记第三周
    setdefault
    Python笔记第三周
    Python笔记第三周
    新增、修改
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    update
    Python笔记第三周
    Python笔记第三周
    删除
    del
    Python笔记第三周
    删除指定的值
    pop
    Python笔记第三周
    popitem
    Python笔记第三周
    全部弹完再次运行就报错
    clear
    Python笔记第三周
    遍历
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    Python笔记第三周
    删除字典中的kv对
    Python笔记第三周
    遍历期间字典长度不可变
    这里用列表记录数据再从字典中一次删除
    Python笔记第三周
    setdefault
    Python笔记第三周
    Python笔记第三周
    update
    Python笔记第三周

Python笔记第三周

  • 封装和解构
    解构
    Python笔记第三周
    Python笔记第三周
    封装
    Python笔记第三周
    剩余变量
    Python笔记第三周
    两边至少拿一个数值
    Python笔记第三周

三级目录