I can't figure out where I made a mistake on this pyhton code because when I run the program the following comes up: main() TypeError: main() missing 9 required positional arguments: 'self', 'month', 'day', 'store', 'location', 'item', 'brand', 'store_type', and 'sale' import csv filename = "sales.csv" with open(filename) as salesData: csvReader = csv.reader(salesData) for row in csvReader: print(row) class Sales: def __init__(self, month, day, store, location, item, brand, store_type, sale): self.month = month self.day = day self.market = store self.type = store_type self.location = location self.item = item self.brand = brand self.sale = sale class Month: def __init__(self, months, day): self.name = months self.day = day def get_month(self): return self.name def get_days(self): return self.day class Brand: def __init__(self, market, store_type, location): self.market = market self.type = store_type self.location = location def get_market(self): return self.market def get_type(self): return self.type def get_location(self): return self.location class Place: def __init__(self, market, store_type, location): self.market = market self.type = store_type self.location = location def get_market(self): return self.market def get_type(self): return self.type def get_location(self): return self.location class Category: def __init__(self, product_type, product_def): self.product_type = product_type self.product_def = product_def def get_product_type(self): return self.product_type def get_product_def(self): return self.product_def def market_share(self, month, day, store, location, item, brand, store_type, sale): sales: Sales = Sales(self, month, day, store, location, item, brand, store_type, sale) for i in sales: total = 0 for j in sale: a1 = month a2 = month b1 = day b2 = day c1 = location c2 = location d1 = item d2 = item e1 = store e2 = store f1 = store_type f2 = store_type g1 = brand g2 = brand h1 = sale h2 = sale if a1 == a2 and b1 == b2 and c1 == c2 and d1 == d2 and e1 == e2 and f1 == f2 and g1 == g2 and h1 == h2: total += sale def main(self, month, day, store, location, item, brand, store_type, sale): sales = list() print(sales) market_share(self, month, day, store, location, item, brand, store_type, sale) for line in sales: print("For the month of", line[0], ',', line[6], line[3], line[4], line[5], "store has sales of $", line[7], "in the ", line[2], "market for a market share of", sales) main()

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I can't figure out where I made a mistake on this pyhton code because when I run the program the following comes up: 

main()
TypeError: main() missing 9 required positional arguments: 'self', 'month', 'day', 'store', 'location', 'item', 'brand', 'store_type', and 'sale'

import csv

filename = "sales.csv"
with open(filename) as salesData:
csvReader = csv.reader(salesData)
for row in csvReader:
print(row)


class Sales:
def __init__(self, month, day, store, location, item, brand, store_type, sale):
self.month = month
self.day = day
self.market = store
self.type = store_type
self.location = location
self.item = item
self.brand = brand
self.sale = sale


class Month:
def __init__(self, months, day):
self.name = months
self.day = day

def get_month(self):
return self.name

def get_days(self):
return self.day


class Brand:
def __init__(self, market, store_type, location):
self.market = market
self.type = store_type
self.location = location

def get_market(self):
return self.market

def get_type(self):
return self.type

def get_location(self):
return self.location


class Place:
def __init__(self, market, store_type, location):
self.market = market
self.type = store_type
self.location = location

def get_market(self):
return self.market

def get_type(self):
return self.type

def get_location(self):
return self.location


class Category:
def __init__(self, product_type, product_def):
self.product_type = product_type
self.product_def = product_def

def get_product_type(self):
return self.product_type

def get_product_def(self):
return self.product_def


def market_share(self, month, day, store, location, item, brand, store_type, sale):
sales: Sales = Sales(self, month, day, store, location, item, brand, store_type, sale)
for i in sales:
total = 0
for j in sale:
a1 = month
a2 = month
b1 = day
b2 = day
c1 = location
c2 = location
d1 = item
d2 = item
e1 = store
e2 = store
f1 = store_type
f2 = store_type
g1 = brand
g2 = brand
h1 = sale
h2 = sale
if a1 == a2 and b1 == b2 and c1 == c2 and d1 == d2 and e1 == e2 and f1 == f2 and g1 == g2 and h1 == h2:
total += sale


def main(self, month, day, store, location, item, brand, store_type, sale):
sales = list()
print(sales)
market_share(self, month, day, store, location, item, brand, store_type, sale)
for line in sales:
print("For the month of", line[0], ',', line[6], line[3], line[4], line[5], "store has sales of $", line[7],
"in the ", line[2], "market for a market share of", sales)


main()

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY