Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import *
- seed(42)
- numbers = [75, -18, 216, 21, -6, 352, 39, -68, -318, 182]
- def nonrand(i):
- return numbers[i]
- def rand():
- return randint(-999, 999)
- def mean(a):
- return float(sum(a)) / max(len(a), 1)
- x = [nonrand(i) for i in range(10)]
- y = [rand() for i in range(10)]
- x.sort()
- y.sort()
- print '\tNONRAND\tRAND\n'
- print 'MIN\t', x[0], '\t', y[0], '\n'
- print 'MAX\t', x[9], '\t', y[9], '\n'
- print 'MEAN\t', mean(x), '\t', mean(y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement