<jupyter_start><jupyter_text><jupyter_code>daily_sales = \
"""<NAME>   ;,;$1.21   ;,;   white ;,; 
09/15/17   ,<NAME>   ;,;   $7.29;,; 
white&blue;,;   09/15/17 ,<NAME> ;,;$12.52 
;,;   white&blue ;,; 09/15/17 ,<NAME>   
;,;   $5.13   ;,; white   ;,; 09/15/17,
<NAME>   ;,;$20.39;,; white&yellow 
;,;09/15/17   ,   <NAME>;,;$30.82;,;   
purple ;,;09/15/17 ,<NAME>;,; $1.85   ;,; 
purple&yellow ;,;09/15/17,   <NAME>;,; 
$17.98;,;purple&yellow ;,; 09/15/17 , 
<NAME> ;,;$17.41;,; blue ;,; 09/15/17, 
<NAME> ;,;$28.59;,; blue;,;   09/15/17   , 
<NAME>;,; $14.51;,;   purple&blue   ;,;   
09/15/17   , <NAME>   ;,; $19.64 ;,; 
white;,;09/15/17   ,   <NAME> ;,; $11.40   
;,; white&red   ;,; 09/15/17, <NAME>;,; 
$8.79 ;,; white&blue&red   ;,;09/15/17   , Peggy Bell;,; $8.65 ;,;blue   ;,; 09/15/17,   <NAME> ;,;   $10.53;,;   green&blue   ;,; 
09/15/17   ,   <NAME>;,;   $16.49;,; 
green&blue&red   ;,;   09/15/17 ,<NAME> 
;,; $6.55 ;,;   green&blue&red;,;   09/15/17 ,
<NAME>;,;   $11.86   ;,;black;,;  
09/15/17,   <NAME>   ;,;   $22.29 ;,;  
black&yellow ;,;09/15/17 , <NAME>   ;,;   
$8.35;,;   white&black&yellow   ;,;   09/15/17,   
<NAME>;,;$2.91 ;,;   white&black&yellow   
;,;09/15/17, <NAME> ;,;$22.94;,;green 
;,;09/15/17,<NAME>;,;$4.70   ;,; green&yellow 
;,; 09/15/17   ,<NAME>;,;   $3.59   
;,;green&yellow&blue;,;   09/15/17   , <NAME>  ;,;$5.66   ;,; green&yellow&purple&blue 
;,;   09/15/17 , <NAME>   ;,;$17.51   ;,;   
black   ;,;   09/15/17 , <NAME> ;,; 
$5.54;,;black&blue   ;,;09/15/17 ,<NAME> ;,; 
$17.13;,; black&blue;,;   09/15/17,   <NAME>;,;   $21.13 ;,;black ;,;09/15/17 ,<NAME>;,; $0.35   ;,; black&purple;,;   09/15/17   ,
<NAME> ;,; $13.91   ;,;   black&purple ;,;   
09/15/17,   <NAME>   ;,;$19.26   ;,; 
yellow;,; 09/15/17   , <NAME>;,; $5.45;,;   
yellow&red ;,;09/15/17 ,   <NAME> ;,;$5.50   
;,;   yellow;,;   09/15/17, <NAME>   ;,; 
$14.56 ;,;   yellow&blue;,;09/15/17 , <NAME>en;,;   $7.33   ;,;   yellow&blue&red
;,; 09/15/17   ,   <NAME>   ;,; $20.22   ;,; 
black ;,;   09/15/17 ,   <NAME>   ;,; $8.67   
;,;black&red  ;,; 09/15/17 ,<NAME> ;,;   
$8.31;,;   black&red ;,;   09/15/17,   <NAME> 
;,;   $15.70   ;,;   white&black&red ;,;09/15/17   
,   <NAME>   ;,;   $6.74   ;,;yellow   ;,; 
09/15/17 , <NAME> ;,;   $30.84   
;,;yellow&black;,;   09/15/17 , <NAME>   ;,; 
$12.31 ;,; green&yellow&black;,;   09/15/17 ,
<NAME>;,;$2.94 ;,; yellow ;,; 09/15/17 
,<NAME> ;,; $22.46   ;,;white&yellow ;,;   
09/15/17,   <NAME> ;,;   $6.60;,;   
white&yellow&black ;,;09/15/17   ,   <NAME>   
;,;   $6.27 ;,; yellow   ;,;09/15/17 ,Guadalupe Potter ;,;$21.12   ;,; yellow;,; 09/15/17   , 
Desiree Butler ;,;$2.10   ;,;white;,; 09/15/17  
,<NAME> ;,; $14.22 ;,;white&black;,;   
09/15/17, <NAME>;,;$11.60;,;white&black   
;,;   09/15/17   ,   <NAME>   ;,; $25.27   ;,; 
white&black&red ;,;09/15/17   ,   <NAME>   
;,;$8.26;,;   purple;,; 09/15/17 ,   <NAME> 
;,;   $30.80 ;,;   purple&yellow   ;,; 09/15/17   , 
<NAME>;,;   $22.61   ;,;   purple&yellow   
;,;09/15/17,<NAME>;,;$22.19 ;,; 
green&purple&yellow ;,;09/15/17   ,<NAME> 
;,; $7.47   ;,; red ;,; 09/15/17 , <NAME>;,;$5.49 ;,; yellow&red ;,;   09/15/17   ,
Terrance Saunders ;,;   $23.70  ;,;green&yellow&red 
;,; 09/15/17 ,   <NAME> ;,; $26.66 ;,; 
red   ;,;09/15/17 ,<NAME> ;,; $25.95;,; 
green&red ;,;   09/15/17   ,<NAME> 
;,;$19.55 ;,; green&white&red ;,;   09/15/17 ,Karl Ross;,;   $15.68;,;   white ;,;   09/15/17 , <NAME> ;,;$23.57;,;   white&red   ;,;09/15/17, 
<NAME>   ;,;$29.32;,; purple;,;09/15/17 ,<NAME>   ;,; $26.44 ;,;   purple   ;,; 09/15/17, 
<NAME>   ;,; $17.24;,;green ;,; 09/15/17   , 
Noah Day ;,;   $8.49   ;,;green   ;,;09/15/17   
,<NAME> ;,;$13.10 ;,;green;,;   09/15/17 ,   <NAME>;,;$20.39 ;,; red   ;,; 09/15/17 ,
Ignacio Parks;,;$14.70   ;,; white&red ;,;09/15/17 
, <NAME> ;,;$22.45   ;,;white&purple&red 
;,;   09/15/17, <NAME>   ;,;   $28.46   ;,;   
red;,;   09/15/17 ,   <NAME> ;,; $23.89;,;   
black&red;,; 09/15/17,   <NAME>   ;,;   
$24.49   ;,; black&red ;,; 09/15/17   , <NAME> ;,;$1.81;,;   black&red ;,; 09/15/17 ,   
<NAME>;,; $6.81   ;,;green;,;   09/15/17   
,   <NAME> ;,;$0.65;,; green&yellow;,; 
09/15/17 , <NAME>   ;,;$26.45;,; 
green&yellow&blue   ;,;   09/15/17,   <NAME> 
;,;   $7.69 ;,; purple;,; 09/15/17,<NAME>   
;,;$8.74   ;,; purple&black   ;,;09/15/17 ,  
<NAME> ;,;   $1.86   ;,;yellow  
;,;09/15/17,<NAME>;,;$14.75   ;,; yellow;,;   
09/15/17   ,<NAME> ;,; $28.10  ;,; 
yellow&blue;,;   09/15/17   , <NAME>   ;,; 
$9.91   ;,; green ;,;09/15/17   ,Jody Flores;,; 
$16.34 ;,; green ;,;   09/15/17,   <NAME> 
;,;$27.57;,; white;,;   09/15/17   , Miguel Mcguire;,;$5.25;,; white&blue   ;,;   09/15/17 ,   
<NAME>;,; $9.51;,;   white&black&blue   
;,;   09/15/17   ,   L<NAME> ;,;$20.56 ;,; 
green;,;   09/15/17,<NAME>;,; $21.64   ;,;   
green&yellow;,;09/15/17,<NAME> ;,;   
$24.99   ;,;   green&yellow&black;,; 09/15/17 ,   
<NAME> ;,;$29.70;,; green ;,; 09/15/17 
,<NAME>;,;   $15.52;,;green;,;   09/15/17 
, <NAME>;,;$15.70 ;,; green&purple;,; 
09/15/17 ,   <NAME> ;,; $12.36 ;,;green ;,; 
09/15/17,<NAME>;,;   $13.66   ;,;   
green&white;,;09/15/17,   <NAME>   ;,;$30.52   
;,; green&white&blue   ;,; 09/15/17 , <NAME> 
;,;   $22.66   ;,; green&white&blue;,;09/15/17"""




daily_sales_replaced=daily_sales.replace(";,;","=")
# print(daily_sales_replaced)
daily_transactions=daily_sales_replaced.split(",")
# print(daily_transactions)

daily_transactions_split=[]
for i in daily_transactions:
  k=i.split("=")
  daily_transactions_split.append(k)
# print(daily_transactions_split)

transactions_clean=[]
for m in daily_transactions_split:
  transaction_clean=[]
  for p in m:
    transaction_clean.append(p.strip())
  transactions_clean.append(transaction_clean)
# print(transactions_clean)

customers=[]
sales=[]
thread_sold=[]
for q in transactions_clean:
  customers.append(q[0])
  sales.append(q[1])
  thread_sold.append(q[2])
# print(customers,sales,thread_sold,sep="\n\n")



"""Determine the total values of the day sales"""

total_sales=0.0
for sale in sales:
  val=sale.strip("$")
  total_sales +=float(val)
# print(total_sales)

"""How much thread of any specific color was sold?"""

# print(thread_sold)

thread_sold_split=[]
for sold in thread_sold:
  if "&" not in sold:
    thread_sold_split.append(sold)
  else:
    spli=sold.split("&")
    for sp in spli:
      thread_sold_split.append(sp)
# print(thread_sold_split)

def color_count(color):
  count = 0
  for thread_color in thread_sold_split:
    if color == thread_color:
      count+= 1
  return count
# print(color_count('white'))

def unique(list1):
  unique_list=[]
  for i in list1:
    if i not in unique_list:
      unique_list.append(i)
  return unique_list
colors=unique(thread_sold_split)
# print(colors)


for color in colors:
  print("Thread shed sold {} threads of {} thread today.".format(color_count(color),color))<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup