Hello! I have been coming to this forum often to check answers and problems when i get stuck and just to learn other techniques others may have. Up until now i have not posted anything, but i am stuck on the Thread Shed Challenge so this is my first question in the forums. I wanna thank you all for your help already. So, when i run my code all i get is
[[‘Myrtle Morris’, ‘$22.66’, ‘green&white&blue’, ‘09/15/17’], [‘Myrtle Morris’, ‘$22.66’, ‘green&white&blue’, ‘09/15/17’], [‘Myrtle Morris’, ‘$22.66’, ‘green&white&blue’, ‘09/15/17’], [‘Myrtle Morris’, ‘$22.66’, ‘green&white&blue’, ‘09/15/17’]]
And This is my code:
daily_sales_replaced = daily_sales.replace(“;,;”, “+”)
daily_transactions = daily_sales_replaced.split(“,”)
#print(daily_transactions)
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_clean:
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)
Why is it that my for loop is not iterating through the whole list and instead it is only giving me one customer, price, and thread? I have been stuck on this problem for 2 days trying to work myself out of it but now it’s time to suck it up and ask for help!!! Can anyone please explain this to me??