Skip to content

Instantly share code, notes, and snippets.

View vedantshetty's full-sized avatar

Vedant shetty vedantshetty

  • Right Behind You
View GitHub Profile
import csv
import unittest
def export_inventory(inventory, filename="export_inventory.csv"):
l = []
with open(filename, "w") as csvfile:
new = csv.writer(csvfile, quoting=csv.QUOTE_MINIMAL)
for key,value in inventory.items():
l+=[key for _ in range(value)]
new.writerow(l)
class TestEquality(unittest.TestCase):