Did I find the right examples for you? yes no

# range

All Samples(197487)  |  Call(197482)  |  Derive(0)  |  Import(5)
```range([start,] stop[, step]) -> list of integers

Return a list containing an arithmetic progression of integers.
range(i, j) returns [i, i+1, i+2, ..., j-1]; start (!) defaults to 0.
When step is given, it specifies the increment (or decrement).
For example, range(4) returns [0, 1, 2, 3].  The end point is omitted!
These are exactly the valid indices for a list of 4 elements.
```

```  def compute_ee_value(self,epos):
pot = 0.0
for i in range(len(epos)):
for j in range(i):
r = self.box.dist(epos[j],epos[i])
```
```  def compute_en_value(self,epos):
pot = 0.0
for i in range(len(epos)):
for j in range(len(self.npos)):
r = self.box.dist(epos[i],self.npos[j])
```
```  def compute_nn_value(self):
if not(self.nn_okay):
pot = 0.0
for i in range(len(self.npos)):
Z1 = self.charges[i]
```

```        v_step = 2 * pi / (inner_slices - 1)
u = 0.
for i in range(slices):
cos_u = cos(u)
sin_u = sin(u)
v = 0.
for j in range(inner_slices):
```
```        # Create a list of triangle indices.
indices = []
for i in range(slices - 1):
for j in range(inner_slices - 1):
p = i * inner_slices + j
```

```        v_step = 2 * pi / (inner_slices - 1)
u = 0.
for i in range(slices):
cos_u = cos(u)
sin_u = sin(u)
v = 0.
for j in range(inner_slices):
```
```        # Create a list of triangle indices.
indices = []
for i in range(slices - 1):
for j in range(inner_slices - 1):
p = i * inner_slices + j
```

```    print 'total surfactant before:', numerix.sum(surfactantVariable * mesh.cellVolumes)

for step in range(steps):
distanceVariable.updateOld()
surfactantEquation.solve(surfactantVariable)
```
```    error = 0.
size = 0
for i in range(len(coverage)):
if coverage[i] > 1e-3:
error += (coverage[i] / answer - 1.)**2
```

```#==============================================================================
z12 = np.arccos(c12)
for i1 in range(0, tht.shape[0]):
for i2 in range(0, tht.shape[1]):
if (s12[i1,i2]>0):
```

```    clevel = zmin + step + arange(nlevel)*step
pllightsource(1., 1., 1.)
for k in range(2):
```

```        self.thknsBtns = {}
tGrid = wx.GridSizer(cols=numCols, hgap=2, vgap=2)
for x in range(1, doodle.maxThickness+1):
b = buttons.GenToggleButton(self, x, str(x), size=btnSize)
b.SetBezelWidth(1)
```

```while True:
time.sleep(numpy.random.random())
for i in range(4):
n+=1
msg = 'ping %i'%n
```

```def rooks(size=8,verbose=0):
variables = []
domains = {}
constraints = []
for i in range(size):
name = 'R%02d'%i
variables.append(name)
domains[name] = fd.FiniteDomain( range(size) )

for r1 in range(size):
```
```
for r1 in range(size):
for r2 in range(size):
q1 = 'R%02d' % r1
q2 = 'R%02d' % r2
```
```    queens.sort()
board += '_'*(size*2+1)+'\n'
for i in range(size):
qj = queens[i][1]
for j in range(size):
```

```    clear((255,255,255))

for i in range(num):
pos[i] = [randrange(0,WIDTH), randrange(0,HEIGHT)]

```
```    fill()

for i in range(num):
x, y = pos[i]

```

Previous  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10  Next