I’m stuck on the Thread Shed project in Python - have exactly the same code as the walkthrough video, but the printed list has extra semi-colons in it, which has not helped when I have had to print out the index for sales etc later on? Can anyone see what I am doing wrong?
Without a link to the lesson, it is difficult to determine the previous steps, but it looks like you’ve replaced ;,;
with a semicolon (;
); however, on the next line, you’re splitting the string at every instance of a comma (,
), which doesn’t seems to be what the instructions are asking.
Hi - I think this was asked for in the instructions, see below:
Split daily_sales_replaced
around commas and save it to a new list daily_transactions
.
I watched the walk-through video, and this was what they did as well, hence why I’m abit confused!
In that case, your output looks alright; it is a list where each element is a separate sale, and the semicolons are there because of the the code on line 110
. I’m sorry if I’ve misunderstood your question, though!
Also, if you want to share all your code, there is a “Copy to clipboard” button at the bottom of the exercise/project. However, you can’t paste it directly into the forums as normal text. To preserve code formatting in forum posts, see: How do I format code in my posts?
That’s ok! It’s just that despite putting the semi colons in (which they did in the video), the list that they had didn’t have them, which I’m sure is causing issues later on when adding customers to a separate list by using an index - when they did the first few lines of code like I have, their list looks slightly different?
Actually I’ve just rewatched it, the semi colons are meant to be there, they used a plus sign instead of semicolons, I think I will do this as well to make it clearer! Thanks for your help - new to Python!
All good—it can be hard to keep track of what the videos are doing, especially if there’s variations in your code. Happy coding!