- range(start, end, step),返回一个list对象也就是range.object,起始值为start,终止值为end,但不含终止值,步长为step。只能创建int型list。
- arange(start, end, step),也不含终止值。但是返回一个array对象。需要导入numpy模块(import numpy as np或者from numpy import*),并且arange可以使用float型数据。
Tips: arange前面的a可以理解为返回一个array对象,所以可以是float类型。