Python 3.6.1:
from random import random
N = 100
a = []
for i in range(N):
a.append(int(random()*2))
print(a[i],end=' ')
print()
for i in range(N):
if (a[i] == 0):
a[i] = 1
else:
a[i] = 0
print(a[i],end=' ')
from random import random
N = 20
a = []
for i in range(N):
a.append(int(random()*(2*N+1)-N))
print(a[i],end=' ')
Max = max(a)
Min = min(a)
print('\nMax =',Max)
print('Min =',Min)
print('Max - Min =',Max-Min)