0201 Python 入门演示

懵懂的女人 提交于 2020-02-07 00:54:31
  • 列表 List: []
  • 集合 Set: {}
  • 字典 Dict: {key: value}
  • 数组 Numpy Arrays: array(List)

Plot: Similar to Matlab


循环 Loop

  • for element in set:
  • 列表推导式(List Comprehension)
numbers = [int(field) for field in fields]
numbers
sum(numbers)
sum([int(field) for field in line.split()])

文件操作File IO
Kind of confused


函数 Function

  • def

模块 Module

  • use import to import a module

类 Class

  • Person(object)
  • __init__: 初始化对象
  • self: 表示对象自身

网络数据 Data from Web

  • url
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!