from threading import Thread
from random import random
from time import sleep

SIZE = 1000000
a = range(SIZE)


def foo():
    for i in range(len(a)):
        a[i] = a[i] * a[i]

def bar():
    for i in range(len(a)):
        a[i] = a[i] * a[i]


t1 = Thread(target=foo)
t2 = Thread(target=bar)

t1.start()
t2.start()

t1.join()
t2.join()

for i, j in zip(a, range(SIZE)):
    if i != (j ** 4): print(i)

