根据SICP,一门语言有以下模式:
primitive expressions, which represent the simplest entities the
language is concerned with,
means of combination, by which compound elements are built
from simpler ones, and
means of abstraction, by which compound elements can be named
and manipulated as units.
if xxx:
elif xxx:
elif xxx:
else:
for x in array:
for x,y in tuple:
It is an object which returns
the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space.
特色
range(5)
## 5为上界
0, 1, 2, 3, 4
## 5为下界,10为上界
range(5, 10)
5, 6, 7, 8, 9
range(5, 10, 4)
## 4为步长
5, 9
range(-10, -100, -30)
## 注意上下界
原文:https://www.cnblogs.com/Neteraxe/p/14023704.html