正在加载图片...
中国科学技术大学电子工程与信息科学系 ©2020 1. 极简入门代码 自编学习示例,如果python环境已配置好,可浏览本小节后再阅读SciPy库内容后开 始实验。 1.1交互式编程 #完成数学计算 3+5 17/5 17/5 2*8 8*2 #变量的使用 width=2 height=4 width*heigh #退出python解释器 quit() #启动python解释器 python #换行符 print("Two\ 学信息科学技术学院,仅用于教学实验 raws Test") #换行符的转义 print("Two W raws Test") 1.1.1 列表(List)的使用 #如果列表中存放的是数值,也被称作数组。 squares=[1,4,9,16,25] squares squares[O]#indexing returns the item squares[3] squares[-1] squares[-2] squares[-3] len(squares) #列表中也可以存放其他格式的数据 cells=[1,2,"3string"] network @ustc.edu.cn中国科学技术大学电子工程与信息科学系 ©2020 network@ustc.edu.cn 1. 极简入门代码 自编学习示例,如果 python 环境已配置好,可浏览本小节后再阅读 SciPy 库内容后开 始实验。 1.1 交互式编程 #完成数学计算 3+5 17/5 17//5 2*8 8**2 #变量的使用 width=2 height=4 width*heigh #退出 python 解释器 quit() #启动 python 解释器 python #换行符 print(“Two \ raws Test”) #换行符的转义 print(“Two \\ raws Test”) 1.1.1 列表(List)的使用 #如果列表中存放的是数值,也被称作数组。 squares = [1, 4, 9, 16, 25] squares squares[0] # indexing returns the item squares[3] squares[-1] squares[-2] squares[-3] len(squares) #列表中也可以存放其他格式的数据 cells=[1,2,"3string"]
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有