Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.61 KB | None | 0 0
  1. daily_sales = \
  2. """Edith Mcbride ;,;$1.21 ;,; white ;,;
  3. 09/15/17 ,Herbert Tran ;,; $7.29;,;
  4. white&blue;,; 09/15/17 ,Paul Clarke ;,;$12.52
  5. ;,; white&blue ;,; 09/15/17 ,Lucille Caldwell
  6. ;,; $5.13 ;,; white ;,; 09/15/17,
  7. Eduardo George ;,;$20.39;,; white&yellow
  8. ;,;09/15/17 , Danny Mclaughlin;,;$30.82;,;
  9. purple ;,;09/15/17 ,Stacy Vargas;,; $1.85 ;,;
  10. purple&yellow ;,;09/15/17, Shaun Brock;,;
  11. $17.98;,;purple&yellow ;,; 09/15/17 ,
  12. Erick Harper ;,;$17.41;,; blue ;,; 09/15/17,
  13. Michelle Howell ;,;$28.59;,; blue;,; 09/15/17 ,
  14. Carroll Boyd;,; $14.51;,; purple&blue ;,;
  15. 09/15/17 , Teresa Carter ;,; $19.64 ;,;
  16. white;,;09/15/17 , Jacob Kennedy ;,; $11.40
  17. ;,; white&red ;,; 09/15/17, Craig Chambers;,;
  18. $8.79 ;,; white&blue&red ;,;09/15/17 , Peggy Bell;,; $8.65 ;,;blue ;,; 09/15/17, Kenneth Cunningham ;,; $10.53;,; green&blue ;,;
  19. 09/15/17 , Marvin Morgan;,; $16.49;,;
  20. green&blue&red ;,; 09/15/17 ,Marjorie Russell
  21. ;,; $6.55 ;,; green&blue&red;,; 09/15/17 ,
  22. Israel Cummings;,; $11.86 ;,;black;,;
  23. 09/15/17, June Doyle ;,; $22.29 ;,;
  24. black&yellow ;,;09/15/17 , Jaime Buchanan ;,;
  25. $8.35;,; white&black&yellow ;,; 09/15/17,
  26. Rhonda Farmer;,;$2.91 ;,; white&black&yellow
  27. ;,;09/15/17, Darren Mckenzie ;,;$22.94;,;green
  28. ;,;09/15/17,Rufus Malone;,;$4.70 ;,; green&yellow
  29. ;,; 09/15/17 ,Hubert Miles;,; $3.59
  30. ;,;green&yellow&blue;,; 09/15/17 , Joseph Bridges ;,;$5.66 ;,; green&yellow&purple&blue
  31. ;,; 09/15/17 , Sergio Murphy ;,;$17.51 ;,;
  32. black ;,; 09/15/17 , Audrey Ferguson ;,;
  33. $5.54;,;black&blue ;,;09/15/17 ,Edna Williams ;,;
  34. $17.13;,; black&blue;,; 09/15/17, Randy Fleming;,; $21.13 ;,;black ;,;09/15/17 ,Elisa Hart;,; $0.35 ;,; black&purple;,; 09/15/17 ,
  35. Ernesto Hunt ;,; $13.91 ;,; black&purple ;,;
  36. 09/15/17, Shannon Chavez ;,;$19.26 ;,;
  37. yellow;,; 09/15/17 , Sammy Cain;,; $5.45;,;
  38. yellow&red ;,;09/15/17 , Steven Reeves ;,;$5.50
  39. ;,; yellow;,; 09/15/17, Ruben Jones ;,;
  40. $14.56 ;,; yellow&blue;,;09/15/17 , Essie Hansen;,; $7.33 ;,; yellow&blue&red
  41. ;,; 09/15/17 , Rene Hardy ;,; $20.22 ;,;
  42. black ;,; 09/15/17 , Lucy Snyder ;,; $8.67
  43. ;,;black&red ;,; 09/15/17 ,Dallas Obrien ;,;
  44. $8.31;,; black&red ;,; 09/15/17, Stacey Payne
  45. ;,; $15.70 ;,; white&black&red ;,;09/15/17
  46. , Tanya Cox ;,; $6.74 ;,;yellow ;,;
  47. 09/15/17 , Melody Moran ;,; $30.84
  48. ;,;yellow&black;,; 09/15/17 , Louise Becker ;,;
  49. $12.31 ;,; green&yellow&black;,; 09/15/17 ,
  50. Ryan Webster;,;$2.94 ;,; yellow ;,; 09/15/17
  51. ,Justin Blake ;,; $22.46 ;,;white&yellow ;,;
  52. 09/15/17, Beverly Baldwin ;,; $6.60;,;
  53. white&yellow&black ;,;09/15/17 , Dale Brady
  54. ;,; $6.27 ;,; yellow ;,;09/15/17 ,Guadalupe Potter ;,;$21.12 ;,; yellow;,; 09/15/17 ,
  55. Desiree Butler ;,;$2.10 ;,;white;,; 09/15/17
  56. ,Sonja Barnett ;,; $14.22 ;,;white&black;,;
  57. 09/15/17, Angelica Garza;,;$11.60;,;white&black
  58. ;,; 09/15/17 , Jamie Welch ;,; $25.27 ;,;
  59. white&black&red ;,;09/15/17 , Rex Hudson
  60. ;,;$8.26;,; purple;,; 09/15/17 , Nadine Gibbs
  61. ;,; $30.80 ;,; purple&yellow ;,; 09/15/17 ,
  62. Hannah Pratt;,; $22.61 ;,; purple&yellow
  63. ;,;09/15/17,Gayle Richards;,;$22.19 ;,;
  64. green&purple&yellow ;,;09/15/17 ,Stanley Holland
  65. ;,; $7.47 ;,; red ;,; 09/15/17 , Anna Dean;,;$5.49 ;,; yellow&red ;,; 09/15/17 ,
  66. Terrance Saunders ;,; $23.70 ;,;green&yellow&red
  67. ;,; 09/15/17 , Brandi Zimmerman ;,; $26.66 ;,;
  68. red ;,;09/15/17 ,Guadalupe Freeman ;,; $25.95;,;
  69. green&red ;,; 09/15/17 ,Irving Patterson
  70. ;,;$19.55 ;,; green&white&red ;,; 09/15/17 ,Karl Ross;,; $15.68;,; white ;,; 09/15/17 , Brandy Cortez ;,;$23.57;,; white&red ;,;09/15/17,
  71. Mamie Riley ;,;$29.32;,; purple;,;09/15/17 ,Mike Thornton ;,; $26.44 ;,; purple ;,; 09/15/17,
  72. Jamie Vaughn ;,; $17.24;,;green ;,; 09/15/17 ,
  73. Noah Day ;,; $8.49 ;,;green ;,;09/15/17
  74. ,Josephine Keller ;,;$13.10 ;,;green;,; 09/15/17 , Tracey Wolfe;,;$20.39 ;,; red ;,; 09/15/17 ,
  75. Ignacio Parks;,;$14.70 ;,; white&red ;,;09/15/17
  76. , Beatrice Newman ;,;$22.45 ;,;white&purple&red
  77. ;,; 09/15/17, Andre Norris ;,; $28.46 ;,;
  78. red;,; 09/15/17 , Albert Lewis ;,; $23.89;,;
  79. black&red;,; 09/15/17, Javier Bailey ;,;
  80. $24.49 ;,; black&red ;,; 09/15/17 , Everett Lyons ;,;$1.81;,; black&red ;,; 09/15/17 ,
  81. Abraham Maxwell;,; $6.81 ;,;green;,; 09/15/17
  82. , Traci Craig ;,;$0.65;,; green&yellow;,;
  83. 09/15/17 , Jeffrey Jenkins ;,;$26.45;,;
  84. green&yellow&blue ;,; 09/15/17, Merle Wilson
  85. ;,; $7.69 ;,; purple;,; 09/15/17,Janis Franklin
  86. ;,;$8.74 ;,; purple&black ;,;09/15/17 ,
  87. Leonard Guerrero ;,; $1.86 ;,;yellow
  88. ;,;09/15/17,Lana Sanchez;,;$14.75 ;,; yellow;,;
  89. 09/15/17 ,Donna Ball ;,; $28.10 ;,;
  90. yellow&blue;,; 09/15/17 , Terrell Barber ;,;
  91. $9.91 ;,; green ;,;09/15/17 ,Jody Flores;,;
  92. $16.34 ;,; green ;,; 09/15/17, Daryl Herrera
  93. ;,;$27.57;,; white;,; 09/15/17 , Miguel Mcguire;,;$5.25;,; white&blue ;,; 09/15/17 ,
  94. Rogelio Gonzalez;,; $9.51;,; white&black&blue
  95. ;,; 09/15/17 , Lora Hammond ;,;$20.56 ;,;
  96. green;,; 09/15/17,Owen Ward;,; $21.64 ;,;
  97. green&yellow;,;09/15/17,Malcolm Morales ;,;
  98. $24.99 ;,; green&yellow&black;,; 09/15/17 ,
  99. Eric Mcdaniel ;,;$29.70;,; green ;,; 09/15/17
  100. ,Madeline Estrada;,; $15.52;,;green;,; 09/15/17
  101. , Leticia Manning;,;$15.70 ;,; green&purple;,;
  102. 09/15/17 , Mario Wallace ;,; $12.36 ;,;green ;,;
  103. 09/15/17,Lewis Glover;,; $13.66 ;,;
  104. green&white;,;09/15/17, Gail Phelps ;,;$30.52
  105. ;,; green&white&blue ;,; 09/15/17 , Myrtle Morris
  106. ;,; $22.66 ;,; green&white&blue;,;09/15/17"""
  107.  
  108. #------------------------------------------------
  109. # Start coding below!
  110. daily_sales_replaced = daily_sales.replace(';,;', '+')
  111. daily_transactions = daily_sales_replaced.split(',')
  112. #print(daily_transactions)
  113.  
  114. daily_transactions_split = []
  115. for transaction in daily_transactions:
  116. daily_transactions_split.append(transaction.split('+'))
  117. #print(daily_transactions_split)
  118.  
  119. transactions_clean = []
  120. for transaction in daily_transactions_split:
  121. transaction_clean = []
  122. for data_point in transaction:
  123. transaction_clean.append(data_point.strip('')
  124. transactions_clean.append(transaction_clean)
  125. #print(transaction_clean)
  126.  
  127. customers = []
  128. sales = []
  129. thread_sold = []
  130.  
  131. for transaction in transactions_clean:
  132. customers.append(transaction[0])
  133. sales.append(transaction[1])
  134. thread_sold.append(transaction[2])
  135.  
  136.  
  137. #print(customers)
  138. #print(sales)
  139. #print(thread_sold)
  140.  
  141. total_sales = 0
  142. for sale in sales:
  143. total_sales += float(sale.strip("$"))
  144. print(total_sales)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement