Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def writeToFile(s, path):
- file = open(path, 'w+', encoding='utf-8')
- file.write(s)
- file.close()
- products = ["ГАЙКИ", "БОЛТЫ", "ШУРУПЫ", "ДРЕЛЬ", "ШУРУПОВЕРТ", "СТРОИТЕЛЬНАЯ ЛИНЕЙКА", "ОТВЕРТКА", "КЛЕЙ-ПИСТОЛЕТ"]
- orders = [] # [[id, [products]], ...]
- for i in range(10000, 15000):
- productsToBuy = []
- for k in products:
- if random.uniform(0, 100) > 20:
- productsToBuy.append(k)
- if len(productsToBuy) == 0:
- productsToBuy = [products[0]]
- orders.append((i, productsToBuy))
- print("Чек Товар")
- for pair in orders:
- id = pair[0]
- orderProducts = pair[1]
- toPrint = str(id) + ' ' + ','.join(orderProducts)
- print(toPrint)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement