I have successfully completed the Thread Shed project. But the way the last step was worded got me thinking: Is there a way to iterate through a list and print the results in the same print() statement?
For example, if I have two simple lists, one with a list of colours (called colours
), and another with a list of counts that correspond to each colour (called counts
), is there a way to print one sentence that says something like, “Today we sold counts[0] number of colours[0], counts[1] number of colours[1], counts[2] number of colours[2] …” etc, until whatever the length of colours
is?
All in one single setence?