Thread shead task 8

So i don’t know why it deletes the string and leaves me with this

Rather than a screenshot, can you please copy and paste (format using the “</>” button above) your code as it’s easier to pinpoint the issue(s)?

What are the results of your first for loop? (daily_transactions_split)

3 Likes
[['Edith Mcbride   ', '$1.21   ', '   white ', ' \n09/15/17   '], ['Herbert Tran   ', '   $7.29', ' \nwhite&blue', '   09/15/17 '], ['Paul Clarke ', '$12.52 \n', '   white&blue ', ' 09/15/17 '], ['Lucille Caldwell   \n', '   $5.13   ', ' white   ', ' 09/15/17'], ['\nEduardo George   ', '$20.39', ' white&yellow \n', '09/15/17   '], ['   Danny Mclaughlin', '$30.82', '   \npurple ', '09/15/17 '], ['Stacy Vargas', ' $1.85   ', ' \npurple&yellow ', '09/15/17'], ['   Shaun Brock', ' \n$17.98', 'purple&yellow ', ' 09/15/17 '], [' \nErick Harper ', '$17.41', ' blue ', ' 09/15/17'], [' \nMichelle Howell ', '$28.59', ' blue', '   09/15/17   '], [' \nCarroll Boyd', ' $14.51', '   purple&blue   ', '   \n09/15/17   '], [' Teresa Carter   ', ' $19.64 ', ' \nwhite', '09/15/17   '], ['   Jacob Kennedy ', ' $11.40   \n', ' white&red   ', ' 09/15/17'], [' Craig Chambers', ' \n$8.79 ', ' white&blue&red   ', '09/15/17   '], [' Peggy Bell', ' $8.65 ', 'blue   ', ' 09/15/17'], ['   Kenneth Cunningham ', '   $10.53', '   green&blue   ', ' \n09/15/17   '], ['   Marvin Morgan', '   $16.49', ' \ngreen&blue&red   ', '   09/15/17 '], ['Marjorie Russell \n', ' $6.55 ', '   green&blue&red', '   09/15/17 '], ['\nIsrael Cummings', '   $11.86   ', 'black', '  \n09/15/17'], ['   June Doyle   ', '   $22.29 ', '  \nblack&yellow ', '09/15/17 '], [' Jaime Buchanan   ', '   \n$8.35', '   white&black&yellow   ', '   09/15/17'], ['   \nRhonda Farmer', '$2.91 ', '   white&black&yellow   \n', '09/15/17'], [' Darren Mckenzie ', '$22.94', 'green \n', '09/15/17'], ['Rufus Malone', '$4.70   ', ' green&yellow \n', ' 09/15/17   '], ['Hubert Miles', '   $3.59   \n', 'green&yellow&blue', '   09/15/17   '], [' Joseph Bridges  ', '$5.66   ', ' green&yellow&purple&blue \n', '   09/15/17 '], [' Sergio Murphy   ', '$17.51   ', '   \nblack   ', '   09/15/17 '], [' Audrey Ferguson ', ' \n$5.54', 'black&blue   ', '09/15/17 '], ['Edna Williams ', ' \n$17.13', ' black&blue', '   09/15/17'], ['   Randy Fleming', '   $21.13 ', 'black ', '09/15/17 '], ['Elisa Hart', ' $0.35   ', ' black&purple', '   09/15/17   '], ['\nErnesto Hunt ', ' $13.91   ', '   black&purple ', '   \n09/15/17'], ['   Shannon Chavez   ', '$19.26   ', ' \nyellow', ' 09/15/17   '], [' Sammy Cain', ' $5.45', '   \nyellow&red ', '09/15/17 '], ['   Steven Reeves ', '$5.50   \n', '   yellow', '   09/15/17'], [' Ruben Jones   ', ' \n$14.56 ', '   yellow&blue', '09/15/17 '], [' Essie Hansen', '   $7.33   ', '   yellow&blue&red\n', ' 09/15/17   '], ['   Rene Hardy   ', ' $20.22   ', ' \nblack ', '   09/15/17 '], ['   Lucy Snyder   ', ' $8.67   \n', 'black&red  ', ' 09/15/17 '], ['Dallas Obrien ', '   \n$8.31', '   black&red ', '   09/15/17'], ['   Stacey Payne \n', '   $15.70   ', '   white&black&red ', '09/15/17   \n'], ['   Tanya Cox   ', '   $6.74   ', 'yellow   ', ' \n09/15/17 '], [' Melody Moran ', '   $30.84   \n', 'yellow&black', '   09/15/17 '], [' Louise Becker   ', ' \n$12.31 ', ' green&yellow&black', '   09/15/17 '], ['\nRyan Webster', '$2.94 ', ' yellow ', ' 09/15/17 \n'], ['Justin Blake ', ' $22.46   ', 'white&yellow ', '   \n09/15/17'], ['   Beverly Baldwin ', '   $6.60', '   \nwhite&yellow&black ', '09/15/17   '], ['   Dale Brady   \n', '   $6.27 ', ' yellow   ', '09/15/17 '], ['Guadalupe Potter ', '$21.12   ', ' yellow', ' 09/15/17   '], [' \nDesiree Butler ', '$2.10   ', 'white', ' 09/15/17  \n'], ['Sonja Barnett ', ' $14.22 ', 'white&black', '   \n09/15/17'], [' Angelica Garza', '$11.60', 'white&black   \n', '   09/15/17   '], ['   Jamie Welch   ', ' $25.27   ', ' \nwhite&black&red ', '09/15/17   '], ['   Rex Hudson   \n', '$8.26', '   purple', ' 09/15/17 '], ['   Nadine Gibbs \n', '   $30.80 ', '   purple&yellow   ', ' 09/15/17   '], [' \nHannah Pratt', '   $22.61   ', '   purple&yellow   \n', '09/15/17'], ['Gayle Richards', '$22.19 ', ' \ngreen&purple&yellow ', '09/15/17   '], ['Stanley Holland \n', ' $7.47   ', ' red ', ' 09/15/17 '], [' Anna Dean', '$5.49 ', ' yellow&red ', '   09/15/17   '], ['\nTerrance Saunders ', '   $23.70  ', 'green&yellow&red \n', ' 09/15/17 '], ['   Brandi Zimmerman ', ' $26.66 ', ' \nred   ', '09/15/17 '], ['Guadalupe Freeman ', ' $25.95', ' \ngreen&red ', '   09/15/17   '], ['Irving Patterson \n', '$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'], [' \nMamie Riley   ', '$29.32', ' purple', '09/15/17 '], ['Mike Thornton   ', ' $26.44 ', '   purple   ', ' 09/15/17'], [' \nJamie Vaughn   ', ' $17.24', 'green ', ' 09/15/17   '], [' \nNoah Day ', '   $8.49   ', 'green   ', '09/15/17   \n'], ['Josephine Keller ', '$13.10 ', 'green', '   09/15/17 '], ['   Tracey Wolfe', '$20.39 ', ' red   ', ' 09/15/17 '], ['\nIgnacio Parks', '$14.70   ', ' white&red ', '09/15/17 \n'], [' Beatrice Newman ', '$22.45   ', 'white&purple&red \n', '   09/15/17'], [' Andre Norris   ', '   $28.46   ', '   \nred', '   09/15/17 '], ['   Albert Lewis ', ' $23.89', '   \nblack&red', ' 09/15/17'], ['   Javier Bailey   ', '   \n$24.49   ', ' black&red ', ' 09/15/17   '], [' Everett Lyons ', '$1.81', '   black&red ', ' 09/15/17 '], ['   \nAbraham Maxwell', ' $6.81   ', 'green', '   09/15/17   \n'], ['   Traci Craig ', '$0.65', ' green&yellow', ' \n09/15/17 '], [' Jeffrey Jenkins   ', '$26.45', ' \ngreen&yellow&blue   ', '   09/15/17'], ['   Merle Wilson \n', '   $7.69 ', ' purple', ' 09/15/17'], ['Janis Franklin   \n', '$8.74   ', ' purple&black   ', '09/15/17 '], ['  \nLeonard Guerrero ', '   $1.86   ', 'yellow  \n', '09/15/17'], ['Lana Sanchez', '$14.75   ', ' yellow', '   \n09/15/17   '], ['Donna Ball ', ' $28.10  ', ' \nyellow&blue', '   09/15/17   '], [' Terrell Barber   ', ' \n$9.91   ', ' green ', '09/15/17   '], ['Jody Flores', ' \n$16.34 ', ' green ', '   09/15/17'], ['   Daryl Herrera \n', '$27.57', ' white', '   09/15/17   '], [' Miguel Mcguire', '$5.25', ' white&blue   ', '   09/15/17 '], ['   \nRogelio Gonzalez', ' $9.51', '   white&black&blue   \n', '   09/15/17   '], ['   Lora Hammond ', '$20.56 ', ' \ngreen', '   09/15/17'], ['Owen Ward', ' $21.64   ', '   \ngreen&yellow', '09/15/17'], ['Malcolm Morales ', '   \n$24.99   ', '   green&yellow&black', ' 09/15/17 '], ['   \nEric Mcdaniel ', '$29.70', ' green ', ' 09/15/17 \n'], ['Madeline Estrada', '   $15.52', 'green', '   09/15/17 \n'], [' Leticia Manning', '$15.70 ', ' green&purple', ' \n09/15/17 '], ['   Mario Wallace ', ' $12.36 ', 'green ', ' \n09/15/17'], ['Lewis Glover', '   $13.66   ', '   \ngreen&white', '09/15/17'], ['   Gail Phelps   ', '$30.52   \n', ' green&white&blue   ', ' 09/15/17 '], [' Myrtle Morris \n', '   $22.66   ', ' green&white&blue', '09/15/17']]
 

Thread Shed
7/22 Complete

Double check what you called that second empty list inside your first for loop.

Also, you’re missing a line of necessary code in the second, nested for loop.

3 Likes
[['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'], ['Lucille Caldwell   \n', '$5.13', 'white', '09/15/17'], ['Lucille Caldwell   \n', '$5.13', 'white', '09/15/17'], ['Lucille Caldwell   \n', '$5.13', 'white', '09/15/17'], ['Lucille Caldwell   \n', '$5.13', 'white', '09/15/17'], ['\nEduardo George', '$20.39', 'white&yellow \n', '09/15/17'], ['\nEduardo George', '$20.39', 'white&yellow \n', '09/15/17'], ['\nEduardo George', '$20.39', 'white&yellow \n', '09/15/17'], ['\nEduardo George', '$20.39', 'white&yellow \n', '09/15/17'], ['Danny Mclaughlin', '$30.82', '\npurple', '09/15/17'], ['Danny Mclaughlin', '$30.82', '\npurple', '09/15/17'], ['Danny Mclaughlin', '$30.82', '\npurple', '09/15/17'], ['Danny Mclaughlin', '$30.82', '\npurple', '09/15/17'], ['Stacy Vargas', '$1.85', '\npurple&yellow', '09/15/17'], ['Stacy Vargas', '$1.85', '\npurple&yellow', '09/15/17'], ['Stacy Vargas', '$1.85', '\npurple&yellow', '09/15/17'], ['Stacy Vargas', '$1.85', '\npurple&yellow', '09/15/17'], ['Shaun Brock', '\n$17.98', 'purple&yellow', '09/15/17'], ['Shaun Brock', '\n$17.98', 'purple&yellow', '09/15/17'], ['Shaun Brock', '\n$17.98', 'purple&yellow', '09/15/17'], ['Shaun Brock', '\n$17.98', 'purple&yellow', '09/15/17'], ['\nErick Harper', '$17.41', 'blue', '09/15/17'], ['\nErick Harper', '$17.41', 'blue', '09/15/17'], ['\nErick Harper', '$17.41', 'blue', '09/15/17'], ['\nErick Harper', '$17.41', 'blue', '09/15/17'], ['\nMichelle Howell', '$28.59', 'blue', '09/15/17'], ['\nMichelle Howell', '$28.59', 'blue', '09/15/17'], ['\nMichelle Howell', '$28.59', 'blue', '09/15/17'], ['\nMichelle Howell', '$28.59', 'blue', '09/15/17'], ['\nCarroll Boyd', '$14.51', 'purple&blue', '\n09/15/17'], ['\nCarroll Boyd', '$14.51', 'purple&blue', '\n09/15/17'], ['\nCarroll Boyd', '$14.51', 'purple&blue', '\n09/15/17'], ['\nCarroll Boyd', '$14.51', 'purple&blue', '\n09/15/17'], ['Teresa Carter', '$19.64', '\nwhite', '09/15/17'], ['Teresa Carter', '$19.64', '\nwhite', '09/15/17'], ['Teresa Carter', '$19.64', '\nwhite', '09/15/17'], ['Teresa Carter', '$19.64', '\nwhite', '09/15/17'], ['Jacob Kennedy', '$11.40   \n', 'white&red', '09/15/17'], ['Jacob Kennedy', '$11.40   \n', 'white&red', '09/15/17'], ['Jacob Kennedy', '$11.40   \n', 'white&red', '09/15/17'], ['Jacob Kennedy', '$11.40   \n', 'white&red', '09/15/17'], ['Craig Chambers', '\n$8.79', 'white&blue&red', '09/15/17'], ['Craig Chambers', '\n$8.79', 'white&blue&red', '09/15/17'], ['Craig Chambers', '\n$8.79', 'white&blue&red', '09/15/17'], ['Craig Chambers', '\n$8.79', 'white&blue&red', '09/15/17'], ['Peggy Bell', '$8.65', 'blue', '09/15/17'], ['Peggy Bell', '$8.65', 'blue', '09/15/17'], ['Peggy Bell', '$8.65', 'blue', '09/15/17'], ['Peggy Bell', '$8.65', 'blue', '09/15/17'], ['Kenneth Cunningham', '$10.53', 'green&blue', '\n09/15/17'], ['Kenneth Cunningham', '$10.53', 'green&blue', '\n09/15/17'], ['Kenneth Cunningham', '$10.53', 'green&blue', '\n09/15/17'], ['Kenneth Cunningham', '$10.53', 'green&blue', '\n09/15/17'], ['Marvin Morgan', '$16.49', '\ngreen&blue&red', '09/15/17'], ['Marvin Morgan', '$16.49', '\ngreen&blue&red', '09/15/17'], ['Marvin Morgan', '$16.49', '\ngreen&blue&red', '09/15/17'], ['Marvin Morgan', '$16.49', '\ngreen&blue&red', '09/15/17'], ['Marjorie Russell \n', '$6.55', 'green&blue&red', '09/15/17'], ['Marjorie Russell \n', '$6.55', 'green&blue&red', '09/15/17'], ['Marjorie Russell \n', '$6.55', 'green&blue&red', '09/15/17'], ['Marjorie Russell \n', '$6.55', 'green&blue&red', '09/15/17'], ['\nIsrael Cummings', '$11.86', 'black', '\n09/15/17'], ['\nIsrael Cummings', '$11.86', 'black', '\n09/15/17'], ['\nIsrael Cummings', '$11.86', 'black', '\n09/15/17'], ['\nIsrael Cummings', '$11.86', 'black', '\n09/15/17'], ['June Doyle', '$22.29', '\nblack&yellow', '09/15/17'], ['June Doyle', '$22.29', '\nblack&yellow', '09/15/17'], ['June Doyle', '$22.29', '\nblack&yellow', '09/15/17'], ['June Doyle', '$22.29', '\nblack&yellow', '09/15/17'], ['Jaime Buchanan', '\n$8.35', 'white&black&yellow', '09/15/17'], ['Jaime Buchanan', '\n$8.35', 'white&black&yellow', '09/15/17'], ['Jaime Buchanan', '\n$8.35', 'white&black&yellow', '09/15/17'], ['Jaime Buchanan', '\n$8.35', 'white&black&yellow', '09/15/17'], ['\nRhonda Farmer', '$2.91', 'white&black&yellow   \n', '09/15/17'], ['\nRhonda Farmer', '$2.91', 'white&black&yellow   \n', '09/15/17'], ['\nRhonda Farmer', '$2.91', 'white&black&yellow   \n', '09/15/17'], ['\nRhonda Farmer', '$2.91', 'white&black&yellow   \n', '09/15/17'], ['Darren Mckenzie', '$22.94', 'green \n', '09/15/17'], ['Darren Mckenzie', '$22.94', 'green \n', '09/15/17'], ['Darren Mckenzie', '$22.94', 'green \n', '09/15/17'], ['Darren Mckenzie', '$22.94', 'green \n', '09/15/17'], ['Rufus Malone', '$4.70', 'green&yellow \n', '09/15/17'], ['Rufus Malone', '$4.70', 'green&yellow \n', '09/15/17'], ['Rufus Malone', '$4.70', 'green&yellow \n', '09/15/17'], ['Rufus Malone', '$4.70', 'green&yellow \n', '09/15/17'], ['Hubert Miles', '$3.59   \n', 'green&yellow&blue', '09/15/17'], ['Hubert Miles', '$3.59   \n', 'green&yellow&blue', '09/15/17'], ['Hubert Miles', '$3.59   \n', 'green&yellow&blue', '09/15/17'], ['Hubert Miles', '$3.59   \n', 'green&yellow&blue', '09/15/17'], ['Joseph Bridges', '$5.66', 'green&yellow&purple&blue \n', '09/15/17'], ['Joseph Bridges', '$5.66', 'green&yellow&purple&blue \n', '09/15/17'], ['Joseph Bridges', '$5.66', 'green&yellow&purple&blue \n', '09/15/17'], ['Joseph Bridges', '$5.66', 'green&yellow&purple&blue \n', '09/15/17'], ['Sergio Murphy', '$17.51', '\nblack', '09/15/17'], ['Sergio Murphy', '$17.51', '\nblack', '09/15/17'], ['Sergio Murphy', '$17.51', '\nblack', '09/15/17'], ['Sergio Murphy', '$17.51', '\nblack', '09/15/17'], ['Audrey Ferguson', '\n$5.54', 'black&blue', '09/15/17'], ['Audrey Ferguson', '\n$5.54', 'black&blue', '09/15/17'], ['Audrey Ferguson', '\n$5.54', 'black&blue', '09/15/17'], ['Audrey Ferguson', '\n$5.54', 'black&blue', '09/15/17'], ['Edna Williams', '\n$17.13', 'black&blue', '09/15/17'], ['Edna Williams', '\n$17.13', 'black&blue', '09/15/17'], ['Edna Williams', '\n$17.13', 'black&blue', '09/15/17'], ['Edna Williams', '\n$17.13', 'black&blue', '09/15/17'], ['Randy Fleming', '$21.13', 'black', '09/15/17'], ['Randy Fleming', '$21.13', 'black', '09/15/17'], ['Randy Fleming', '$21.13', 'black', '09/15/17'], ['Randy Fleming', '$21.13', 'black', '09/15/17'], ['Elisa Hart', '$0.35', 'black&purple', '09/15/17'], ['Elisa Hart', '$0.35', 'black&purple', '09/15/17'], ['Elisa Hart', '$0.35', 'black&purple', '09/15/17'], ['Elisa Hart', '$0.35', 'black&purple', '09/15/17'], ['\nErnesto Hunt', '$13.91', 'black&purple', '\n09/15/17'], ['\nErnesto Hunt', '$13.91', 'black&purple', '\n09/15/17'], ['\nErnesto Hunt', '$13.91', 'black&purple', '\n09/15/17'], ['\nErnesto Hunt', '$13.91', 'black&purple', '\n09/15/17'], ['Shannon Chavez', '$19.26', '\nyellow', '09/15/17'], ['Shannon Chavez', '$19.26', '\nyellow', '09/15/17'], ['Shannon Chavez', '$19.26', '\nyellow', '09/15/17'], ['Shannon Chavez', '$19.26', '\nyellow', '09/15/17'], ['Sammy Cain', '$5.45', '\nyellow&red', '09/15/17'], ['Sammy Cain', '$5.45', '\nyellow&red', '09/15/17'], ['Sammy Cain', '$5.45', '\nyellow&red', '09/15/17'], ['Sammy Cain', '$5.45', '\nyellow&red', '09/15/17'], ['Steven Reeves', '$5.50   \n', 'yellow', '09/15/17'], ['Steven Reeves', '$5.50   \n', 'yellow', '09/15/17'], ['Steven Reeves', '$5.50   \n', 'yellow', '09/15/17'], ['Steven Reeves', '$5.50   \n', 'yellow', '09/15/17'], ['Ruben Jones', '\n$14.56', 'yellow&blue', '09/15/17'], ['Ruben Jones', '\n$14.56', 'yellow&blue', '09/15/17'], ['Ruben Jones', '\n$14.56', 'yellow&blue', '09/15/17'], ['Ruben Jones', '\n$14.56', 'yellow&blue', '09/15/17'], ['Essie Hansen', '$7.33', 'yellow&blue&red\n', '09/15/17'], ['Essie Hansen', '$7.33', 'yellow&blue&red\n', '09/15/17'], ['Essie Hansen', '$7.33', 'yellow&blue&red\n', '09/15/17'], ['Essie Hansen', '$7.33', 'yellow&blue&red\n', '09/15/17'], ['Rene Hardy', '$20.22', '\nblack', '09/15/17'], ['Rene Hardy', '$20.22', '\nblack', '09/15/17'], ['Rene Hardy', '$20.22', '\nblack', '09/15/17'], ['Rene Hardy', '$20.22', '\nblack', '09/15/17'], ['Lucy Snyder', '$8.67   \n', 'black&red', '09/15/17'], ['Lucy Snyder', '$8.67   \n', 'black&red', '09/15/17'], ['Lucy Snyder', '$8.67   \n', 'black&red', '09/15/17'], ['Lucy Snyder', '$8.67   \n', 'black&red', '09/15/17'], ['Dallas Obrien', '\n$8.31', 'black&red', '09/15/17'], ['Dallas Obrien', '\n$8.31', 'black&red', '09/15/17'], ['Dallas Obrien', '\n$8.31', 'black&red', '09/15/17'], ['Dallas Obrien', '\n$8.31', 'black&red', '09/15/17'], ['Stacey Payne \n', '$15.70', 'white&black&red', '09/15/17   \n'], ['Stacey Payne \n', '$15.70', 'white&black&red', '09/15/17   \n'], ['Stacey Payne \n', '$15.70', 'white&black&red', '09/15/17   \n'], ['Stacey Payne \n', '$15.70', 'white&black&red', '09/15/17   \n'], ['Tanya Cox', '$6.74', 'yellow', '\n09/15/17'], ['Tanya Cox', '$6.74', 'yellow', '\n09/15/17'], ['Tanya Cox', '$6.74', 'yellow', '\n09/15/17'], ['Tanya Cox', '$6.74', 'yellow', '\n09/15/17'], ['Melody Moran', '$30.84   \n', 'yellow&black', '09/15/17'], ['Melody Moran', '$30.84   \n', 'yellow&black', '09/15/17'], ['Melody Moran', '$30.84   \n', 'yellow&black', '09/15/17'], ['Melody Moran', '$30.84   \n', 'yellow&black', '09/15/17'], ['Louise Becker', '\n$12.31', 'green&yellow&black', '09/15/17'], ['Louise Becker', '\n$12.31', 'green&yellow&black', '09/15/17'], ['Louise Becker', '\n$12.31', 'green&yellow&black', '09/15/17'], ['Louise Becker', '\n$12.31', 'green&yellow&black', '09/15/17'], ['\nRyan Webster', '$2.94', 'yellow', '09/15/17 \n'], ['\nRyan Webster', '$2.94', 'yellow', '09/15/17 \n'], ['\nRyan Webster', '$2.94', 'yellow', '09/15/17 \n'], ['\nRyan Webster', '$2.94', 'yellow', '09/15/17 \n'], ['Justin Blake', '$22.46', 'white&yellow', '\n09/15/17'], ['Justin Blake', '$22.46', 'white&yellow', '\n09/15/17'], ['Justin Blake', '$22.46', 'white&yellow', '\n09/15/17'], ['Justin Blake', '$22.46', 'white&yellow', '\n09/15/17'], ['Beverly Baldwin', '$6.60', '\nwhite&yellow&black', '09/15/17'], ['Beverly Baldwin', '$6.60', '\nwhite&yellow&black', '09/15/17'], ['Beverly Baldwin', '$6.60', '\nwhite&yellow&black', '09/15/17'], ['Beverly Baldwin', '$6.60', '\nwhite&yellow&black', '09/15/17'], ['Dale Brady   \n', '$6.27', 'yellow', '09/15/17'], ['Dale Brady   \n', '$6.27', 'yellow', '09/15/17'], ['Dale Brady   \n', '$6.27', 'yellow', '09/15/17'], ['Dale Brady   \n', '$6.27', 'yellow', '09/15/17'], ['Guadalupe Potter', '$21.12', 'yellow', '09/15/17'], ['Guadalupe Potter', '$21.12', 'yellow', '09/15/17'], ['Guadalupe Potter', '$21.12', 'yellow', '09/15/17'], ['Guadalupe Potter', '$21.12', 'yellow', '09/15/17'], ['\nDesiree Butler', '$2.10', 'white', '09/15/17  \n'], ['\nDesiree Butler', '$2.10', 'white', '09/15/17  \n'], ['\nDesiree Butler', '$2.10', 'white', '09/15/17  \n'], ['\nDesiree Butler', '$2.10', 'white', '09/15/17  \n'], ['Sonja Barnett', '$14.22', 'white&black', '\n09/15/17'], ['Sonja Barnett', '$14.22', 'white&black', '\n09/15/17'], ['Sonja Barnett', '$14.22', 'white&black', '\n09/15/17'], ['Sonja Barnett', '$14.22', 'white&black', '\n09/15/17'], ['Angelica Garza', '$11.60', 'white&black   \n', '09/15/17'], ['Angelica Garza', '$11.60', 'white&black   \n', '09/15/17'], ['Angelica Garza', '$11.60', 'white&black   \n', '09/15/17'], ['Angelica Garza', '$11.60', 'white&black   \n', '09/15/17'], ['Jamie Welch', '$25.27', '\nwhite&black&red', '09/15/17'], ['Jamie Welch', '$25.27', '\nwhite&black&red', '09/15/17'], ['Jamie Welch', '$25.27', '\nwhite&black&red', '09/15/17'], ['Jamie Welch', '$25.27', '\nwhite&black&red', '09/15/17'], ['Rex Hudson   \n', '$8.26', 'purple', '09/15/17'], ['Rex Hudson   \n', '$8.26', 'purple', '09/15/17'], ['Rex Hudson   \n', '$8.26', 'purple', '09/15/17'], ['Rex Hudson   \n', '$8.26', 'purple', '09/15/17'], ['Nadine Gibbs \n', '$30.80', 'purple&yellow', '09/15/17'], ['Nadine Gibbs \n', '$30.80', 'purple&yellow', '09/15/17'], ['Nadine Gibbs \n', '$30.80', 'purple&yellow', '09/15/17'], ['Nadine Gibbs \n', '$30.80', 'purple&yellow', '09/15/17'], ['\nHannah Pratt', '$22.61', 'purple&yellow   \n', '09/15/17'], ['\nHannah Pratt', '$22.61', 'purple&yellow   \n', '09/15/17'], ['\nHannah Pratt', '$22.61', 'purple&yellow   \n', '09/15/17'], ['\nHannah Pratt', '$22.61', 'purple&yellow   \n', '09/15/17'], ['Gayle Richards', '$22.19', '\ngreen&purple&yellow', '09/15/17'], ['Gayle Richards', '$22.19', '\ngreen&purple&yellow', '09/15/17'], ['Gayle Richards', '$22.19', '\ngreen&purple&yellow', '09/15/17'], ['Gayle Richards', '$22.19', '\ngreen&purple&yellow', '09/15/17'], ['Stanley Holland \n', '$7.47', 'red', '09/15/17'], ['Stanley Holland \n', '$7.47', 'red', '09/15/17'], ['Stanley Holland \n', '$7.47', 'red', '09/15/17'], ['Stanley Holland \n', '$7.47', 'red', '09/15/17'], ['Anna Dean', '$5.49', 'yellow&red', '09/15/17'], ['Anna Dean', '$5.49', 'yellow&red', '09/15/17'], ['Anna Dean', '$5.49', 'yellow&red', '09/15/17'], ['Anna Dean', '$5.49', 'yellow&red', '09/15/17'], ['\nTerrance Saunders', '$23.70', 'green&yellow&red \n', '09/15/17'], ['\nTerrance Saunders', '$23.70', 'green&yellow&red \n', '09/15/17'], ['\nTerrance Saunders', '$23.70', 'green&yellow&red \n', '09/15/17'], ['\nTerrance Saunders', '$23.70', 'green&yellow&red \n', '09/15/17'], ['Brandi Zimmerman', '$26.66', '\nred', '09/15/17'], ['Brandi Zimmerman', '$26.66', '\nred', '09/15/17'], ['Brandi Zimmerman', '$26.66', '\nred', '09/15/17'], ['Brandi Zimmerman', '$26.66', '\nred', '09/15/17'], ['Guadalupe Freeman', '$25.95', '\ngreen&red', '09/15/17'], ['Guadalupe Freeman', '$25.95', '\ngreen&red', '09/15/17'], ['Guadalupe Freeman', '$25.95', '\ngreen&red', '09/15/17'], ['Guadalupe Freeman', '$25.95', '\ngreen&red', '09/15/17'], ['Irving Patterson \n', '$19.55', 'green&white&red', '09/15/17'], ['Irving Patterson \n', '$19.55', 'green&white&red', '09/15/17'], ['Irving Patterson \n', '$19.55', 'green&white&red', '09/15/17'], ['Irving Patterson \n', '$19.55', 'green&white&red', '09/15/17'], ['Karl Ross', '$15.68', 'white', '09/15/17'], ['Karl Ross', '$15.68', 'white', '09/15/17'], ['Karl Ross', '$15.68', 'white', '09/15/17'], ['Karl Ross', '$15.68', 'white', '09/15/17'], ['Brandy Cortez', '$23.57', 'white&red', '09/15/17'], ['Brandy Cortez', '$23.57', 'white&red', '09/15/17'], ['Brandy Cortez', '$23.57', 'white&red', '09/15/17'], ['Brandy Cortez', '$23.57', 'white&red', '09/15/17'], ['\nMamie Riley', '$29.32', 'purple', '09/15/17'], ['\nMamie Riley', '$29.32', 'purple', '09/15/17'], ['\nMamie Riley', '$29.32', 'purple', '09/15/17'], ['\nMamie Riley', '$29.32', 'purple', '09/15/17'], ['Mike Thornton', '$26.44', 'purple', '09/15/17'], ['Mike Thornton', '$26.44', 'purple', '09/15/17'], ['Mike Thornton', '$26.44', 'purple', '09/15/17'], ['Mike Thornton', '$26.44', 'purple', '09/15/17'], ['\nJamie Vaughn', '$17.24', 'green', '09/15/17'], ['\nJamie Vaughn', '$17.24', 'green', '09/15/17'], ['\nJamie Vaughn', '$17.24', 'green', '09/15/17'], ['\nJamie Vaughn', '$17.24', 'green', '09/15/17'], ['\nNoah Day', '$8.49', 'green', '09/15/17   \n'], ['\nNoah Day', '$8.49', 'green', '09/15/17   \n'], ['\nNoah Day', '$8.49', 'green', '09/15/17   \n'], ['\nNoah Day', '$8.49', 'green', '09/15/17   \n'], ['Josephine Keller', '$13.10', 'green', '09/15/17'], ['Josephine Keller', '$13.10', 'green', '09/15/17'], ['Josephine Keller', '$13.10', 'green', '09/15/17'], ['Josephine Keller', '$13.10', 'green', '09/15/17'], ['Tracey Wolfe', '$20.39', 'red', '09/15/17'], ['Tracey Wolfe', '$20.39', 'red', '09/15/17'], ['Tracey Wolfe', '$20.39', 'red', '09/15/17'], ['Tracey Wolfe', '$20.39', 'red', '09/15/17'], ['\nIgnacio Parks', '$14.70', 'white&red', '09/15/17 \n'], ['\nIgnacio Parks', '$14.70', 'white&red', '09/15/17 \n'], ['\nIgnacio Parks', '$14.70', 'white&red', '09/15/17 \n'], ['\nIgnacio Parks', '$14.70', 'white&red', '09/15/17 \n'], ['Beatrice Newman', '$22.45', 'white&purple&red \n', '09/15/17'], ['Beatrice Newman', '$22.45', 'white&purple&red \n', '09/15/17'], ['Beatrice Newman', '$22.45', 'white&purple&red \n', '09/15/17'], ['Beatrice Newman', '$22.45', 'white&purple&red \n', '09/15/17'], ['Andre Norris', '$28.46', '\nred', '09/15/17'], ['Andre Norris', '$28.46', '\nred', '09/15/17'], ['Andre Norris', '$28.46', '\nred', '09/15/17'], ['Andre Norris', '$28.46', '\nred', '09/15/17'], ['Albert Lewis', '$23.89', '\nblack&red', '09/15/17'], ['Albert Lewis', '$23.89', '\nblack&red', '09/15/17'], ['Albert Lewis', '$23.89', '\nblack&red', '09/15/17'], ['Albert Lewis', '$23.89', '\nblack&red', '09/15/17'], ['Javier Bailey', '\n$24.49', 'black&red', '09/15/17'], ['Javier Bailey', '\n$24.49', 'black&red', '09/15/17'], ['Javier Bailey', '\n$24.49', 'black&red', '09/15/17'], ['Javier Bailey', '\n$24.49', 'black&red', '09/15/17'], ['Everett Lyons', '$1.81', 'black&red', '09/15/17'], ['Everett Lyons', '$1.81', 'black&red', '09/15/17'], ['Everett Lyons', '$1.81', 'black&red', '09/15/17'], ['Everett Lyons', '$1.81', 'black&red', '09/15/17'], ['\nAbraham Maxwell', '$6.81', 'green', '09/15/17   \n'], ['\nAbraham Maxwell', '$6.81', 'green', '09/15/17   \n'], ['\nAbraham Maxwell', '$6.81', 'green', '09/15/17   \n'], ['\nAbraham Maxwell', '$6.81', 'green', '09/15/17   \n'], ['Traci Craig', '$0.65', 'green&yellow', '\n09/15/17'], ['Traci Craig', '$0.65', 'green&yellow', '\n09/15/17'], ['Traci Craig', '$0.65', 'green&yellow', '\n09/15/17'], ['Traci Craig', '$0.65', 'green&yellow', '\n09/15/17'], ['Jeffrey Jenkins', '$26.45', '\ngreen&yellow&blue', '09/15/17'], ['Jeffrey Jenkins', '$26.45', '\ngreen&yellow&blue', '09/15/17'], ['Jeffrey Jenkins', '$26.45', '\ngreen&yellow&blue', '09/15/17'], ['Jeffrey Jenkins', '$26.45', '\ngreen&yellow&blue', '09/15/17'], ['Merle Wilson \n', '$7.69', 'purple', '09/15/17'], ['Merle Wilson \n', '$7.69', 'purple', '09/15/17'], ['Merle Wilson \n', '$7.69', 'purple', '09/15/17'], ['Merle Wilson \n', '$7.69', 'purple', '09/15/17'], ['Janis Franklin   \n', '$8.74', 'purple&black', '09/15/17'], ['Janis Franklin   \n', '$8.74', 'purple&black', '09/15/17'], ['Janis Franklin   \n', '$8.74', 'purple&black', '09/15/17'], ['Janis Franklin   \n', '$8.74', 'purple&black', '09/15/17'], ['\nLeonard Guerrero', '$1.86', 'yellow  \n', '09/15/17'], ['\nLeonard Guerrero', '$1.86', 'yellow  \n', '09/15/17'], ['\nLeonard Guerrero', '$1.86', 'yellow  \n', '09/15/17'], ['\nLeonard Guerrero', '$1.86', 'yellow  \n', '09/15/17'], ['Lana Sanchez', '$14.75', 'yellow', '\n09/15/17'], ['Lana Sanchez', '$14.75', 'yellow', '\n09/15/17'], ['Lana Sanchez', '$14.75', 'yellow', '\n09/15/17'], ['Lana Sanchez', '$14.75', 'yellow', '\n09/15/17'], ['Donna Ball', '$28.10', '\nyellow&blue', '09/15/17'], ['Donna Ball', '$28.10', '\nyellow&blue', '09/15/17'], ['Donna Ball', '$28.10', '\nyellow&blue', '09/15/17'], ['Donna Ball', '$28.10', '\nyellow&blue', '09/15/17'], ['Terrell Barber', '\n$9.91', 'green', '09/15/17'], ['Terrell Barber', '\n$9.91', 'green', '09/15/17'], ['Terrell Barber', '\n$9.91', 'green', '09/15/17'], ['Terrell Barber', '\n$9.91', 'green', '09/15/17'], ['Jody Flores', '\n$16.34', 'green', '09/15/17'], ['Jody Flores', '\n$16.34', 'green', '09/15/17'], ['Jody Flores', '\n$16.34', 'green', '09/15/17'], ['Jody Flores', '\n$16.34', 'green', '09/15/17'], ['Daryl Herrera \n', '$27.57', 'white', '09/15/17'], ['Daryl Herrera \n', '$27.57', 'white', '09/15/17'], ['Daryl Herrera \n', '$27.57', 'white', '09/15/17'], ['Daryl Herrera \n', '$27.57', 'white', '09/15/17'], ['Miguel Mcguire', '$5.25', 'white&blue', '09/15/17'], ['Miguel Mcguire', '$5.25', 'white&blue', '09/15/17'], ['Miguel Mcguire', '$5.25', 'white&blue', '09/15/17'], ['Miguel Mcguire', '$5.25', 'white&blue', '09/15/17'], ['\nRogelio Gonzalez', '$9.51', 'white&black&blue   \n', '09/15/17'], ['\nRogelio Gonzalez', '$9.51', 'white&black&blue   \n', '09/15/17'], ['\nRogelio Gonzalez', '$9.51', 'white&black&blue   \n', '09/15/17'], ['\nRogelio Gonzalez', '$9.51', 'white&black&blue   \n', '09/15/17'], ['Lora Hammond', '$20.56', '\ngreen', '09/15/17'], ['Lora Hammond', '$20.56', '\ngreen', '09/15/17'], ['Lora Hammond', '$20.56', '\ngreen', '09/15/17'], ['Lora Hammond', '$20.56', '\ngreen', '09/15/17'], ['Owen Ward', '$21.64', '\ngreen&yellow', '09/15/17'], ['Owen Ward', '$21.64', '\ngreen&yellow', '09/15/17'], ['Owen Ward', '$21.64', '\ngreen&yellow', '09/15/17'], ['Owen Ward', '$21.64', '\ngreen&yellow', '09/15/17'], ['Malcolm Morales', '\n$24.99', 'green&yellow&black', '09/15/17'], ['Malcolm Morales', '\n$24.99', 'green&yellow&black', '09/15/17'], ['Malcolm Morales', '\n$24.99', 'green&yellow&black', '09/15/17'], ['Malcolm Morales', '\n$24.99', 'green&yellow&black', '09/15/17'], ['\nEric Mcdaniel', '$29.70', 'green', '09/15/17 \n'], ['\nEric Mcdaniel', '$29.70', 'green', '09/15/17 \n'], ['\nEric Mcdaniel', '$29.70', 'green', '09/15/17 \n'], ['\nEric Mcdaniel', '$29.70', 'green', '09/15/17 \n'], ['Madeline Estrada', '$15.52', 'green', '09/15/17 \n'], ['Madeline Estrada', '$15.52', 'green', '09/15/17 \n'], ['Madeline Estrada', '$15.52', 'green', '09/15/17 \n'], ['Madeline Estrada', '$15.52', 'green', '09/15/17 \n'], ['Leticia Manning', '$15.70', 'green&purple', '\n09/15/17'], ['Leticia Manning', '$15.70', 'green&purple', '\n09/15/17'], ['Leticia Manning', '$15.70', 'green&purple', '\n09/15/17'], ['Leticia Manning', '$15.70', 'green&purple', '\n09/15/17'], ['Mario Wallace', '$12.36', 'green', '\n09/15/17'], ['Mario Wallace', '$12.36', 'green', '\n09/15/17'], ['Mario Wallace', '$12.36', 'green', '\n09/15/17'], ['Mario Wallace', '$12.36', 'green', '\n09/15/17'], ['Lewis Glover', '$13.66', '\ngreen&white', '09/15/17'], ['Lewis Glover', '$13.66', '\ngreen&white', '09/15/17'], ['Lewis Glover', '$13.66', '\ngreen&white', '09/15/17'], ['Lewis Glover', '$13.66', '\ngreen&white', '09/15/17'], ['Gail Phelps', '$30.52   \n', 'green&white&blue', '09/15/17'], ['Gail Phelps', '$30.52   \n', 'green&white&blue', '09/15/17'], ['Gail Phelps', '$30.52   \n', 'green&white&blue', '09/15/17'], ['Gail Phelps', '$30.52   \n', 'green&white&blue', '09/15/17'], ['Myrtle Morris \n', '$22.66', 'green&white&blue', '09/15/17'], ['Myrtle Morris \n', '$22.66', 'green&white&blue', '09/15/17'], ['Myrtle Morris \n', '$22.66', 'green&white&blue', '09/15/17'], ['Myrtle Morris \n', '$22.66', 'green&white&blue', '09/15/17']]


it give me this
i did this

type or paste code here
```daily_sales_replace = daily_sales.replace(";,;", "+")
daily_transactions = daily_sales_replace.split(",")


daily_transactions_split = []
for transactions in daily_transactions:
  daily_transactions_split.append(transactions.split("+"))

transactions_clean = []
for transaction in daily_transactions_split:
  transaction_clean = []
  for data_points in transaction:
    transaction_clean.append(data_points.strip(" "))
    transactions_clean.append(transaction_clean)


print(transactions_clean)
daily_transactions = daily_sales_replace.split(",")


daily_transactions_split = []
for transactions in daily_transactions:
  daily_transactions_split.append(transactions.split("+"))

transactions_clean = []
for transaction in daily_transactions_split:
  transaction_clean = []
  for data_points in transaction:
    transaction_clean.append(data_points.replace("\n", "").strip(" "))
    transactions_clean.append(transaction_clean)


print(transactions_clean)
type or paste code here
```I used replace and is more clean

Yep, you caught it. You have to use .replace() there.

Now, consider the list sales . It is a list of strings that we want to sum. In order for us to sum these values, we will have to remove the $ , and set them equal to floats.

Iterate through sales and for each item, strip off the $ , set it equal to a float, and add it to total_sales

I don’t understand
i know how to remove th dollar sign but how to i set equal to a float?

What does your code look like for this step? Break it down.
Do you know how to convert a string to an int?
So, then, how would you convert a string to a floating point number?

by ussing float() aaaa i get it now

1 Like

And at task 18
Next, iterate through thread_sold. For each item, check if it is a single color or multiple colors. If it is a single color, append that color to thread_sold_split .

If it is multiple colors, first split the string around the & character and then add each color indivudally to thread_sold_split

what single color and multicolor?
How can i write them?

what have you written so far?
I think it’s easiest to break down the question into more digestible bits.

So,

  1. you’re iterating through the list thread_sold,
  2. then adding the color (if it’s just one color) to another list called, thread_sold_split.
  3. BUT, if it’s say, two colors, green&red, then you have to split that into two colors and add each individual color to that list thread_sold_split.

You already know how to use the .split() method b/c you used it above…

1 Like

Ya i give up and watch the video and still manage to ■■■■ up and don’t know what i did


This is the code

daily_sales_replace =  daily_sales.replace(';,;', '+')
daily_transactions =daily_sales_replace.split(',')

daily_transactions_split = []
for transactions in daily_transactions:
  daily_transactions_split.append(transactions.split('+'))

transactions_clean = []
for transactions in daily_transactions_split:
  transaction_clean = []
  for data_points in transactions:

   transaction_clean.append(data_points.replace('\n', '').strip(' '))
   transactions_clean.append(transaction_clean)


customers = []
sales = []
thread_sold = []

for transactions in transactions_clean:
  customers.append(transactions[0])
  sales.append(transactions[1])
  thread_sold.append(transactions[2])


total_sales = 0
for item in sales:
  total_sales += float(item.strip('$'))

thread_sold_split = []
for item in thread_sold_split:
  for color in item.split('&'):
    thread_sold_split.append(color)


def color_count(color):
  color_count = 0
  for thread_count in thread_sold_split:
    if color == thread_count:
      color_count += 1
      return color_count

colors = ['red','yellow','green','white','black','blue','purple']

for color in colors:
  print("Thread Shed sold {} threads of {} thread today.".format(color_count(color), color))

It’s helpful if you can print out each chunk of code in a different cell (in a code editor like Jupyter or Colab), or, in the console in the learning environment. Then, you can see what doesn’t print() out and fix those parts of the code.

This bit of code is incorrect. Check that first for loop.

Also, go back over your last function. You need to call that function and pass arguments (the various colors) through it with a print(). (you don’t need that last for loop nor do you need to define the colors above it).

1 Like