2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Name Python variables in snake case

This commit is contained in:
Martin Thoma 2015-11-20 08:14:39 +01:00
parent 6364e13a6a
commit bc873eab9b

View file

@ -5,22 +5,22 @@ from random import uniform
import random import random
n = 5 n = 5
xMin, yMin = 0, 0 x_min, y_min = 0, 0
xMax, yMax = 5, 5 x_max, y_max = 5, 5
xSum = 0 x_sum = 0
ySum = 0 y_sum = 0
coordinates = [] coordinates = []
random.seed(42) random.seed(42)
for i in range(n): for i in range(n):
x = uniform(xMin, xMax) x = uniform(x_min, x_max)
y = uniform(yMin, yMax) y = uniform(y_min, y_max)
xSum += x x_sum += x
ySum += y y_sum += y
coordinates.append((x, y)) coordinates.append((x, y))
center = (float(xSum) / n, float(ySum) / n) center = (float(x_sum) / n, float(y_sum) / n)
cx, cy = center cx, cy = center
point_coords = "" point_coords = ""