import random product = {1:{'sell':0, 'paid':0}, 2:{'sell':0, 'paid':0}, 3:{'sell':0, 'paid':0}, 4:{'sell':0, 'paid':0}} for i in range(1,5): number1 = random.randint(1,10) number2 = random.randint(1,10) product[i]['sell'] = number1 product[i]['said'] = number2 print product