You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility
When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!
I can’t figure out why, but the console is printing out each item 4 times in a row. —
[[‘Edith Mcbride’, ‘$1.21’, ‘white’, ‘\n09/15/17’], [‘Edith Mcbride’, ‘$1.21’, ‘white’, ‘\n09/15/17’], [‘Edith Mcbride’, ‘$1.21’, ‘white’, ‘\n09/15/17’], [‘Edith Mcbride’, ‘$1.21’, ‘white’, ‘\n09/15/17’], [‘Herbert Tran’, ‘$7.29’, ‘\nwhite&blue’, ‘09/15/17’], [‘Herbert Tran’, ‘$7.29’, ‘\nwhite&blue’, ‘09/15/17’], [‘Herbert Tran’, ‘$7.29’, ‘\nwhite&blue’, ‘09/15/17’], [‘Herbert Tran’, ‘$7.29’, ‘\nwhite&blue’, ‘09/15/17’], [‘Paul Clarke’, ‘$12.52 \n’, ‘white&blue’, ‘09/15/17’], [‘Paul Clarke’, ‘$12.52 \n’, ‘white&blue’, ‘09/15/17’], [‘Paul Clarke’, ‘$12.52 \n’, ‘white&blue’, ‘09/15/17’], [‘Paul Clarke’, ‘$12.52 \n’, ‘white&blue’, ‘09/15/17’]
daily_sales_replaced = daily_sales.replace(“;,;”,“+”)
daily_transactions = daily_sales_replaced.split(“,”)
daily_transactions_split =
for transaction in daily_transactions:
daily_transactions_split.append(transaction.split(“+”))
print(daily_transactions_split)
transactions_clean =
for transaction in daily_transactions_split:
transaction_clean =
for data_point in transaction:
transaction_clean.append(data_point.replace(“\n”,“”).strip(" "))
transactions_clean.append(transaction_clean)
print(transactions_clean)
customers =
sales =
thread_sold =
for transaction in transactions_clean:
customers.append(transaction[0])
sales.append(transaction[1])
thread_sold.append(transaction[2])
print(customers)
print(sales)
print(thread_sold)
total_sales = 0
for sale in sales:
total_sales += float(sale.strip(“$”))
print(total_sales)
what am I doing wrong???