Download presentation
Presentation is loading. Please wait.
1
Lists in Python Outputting lists
2
How to output a list Very simplest way – just print the name of the list print(myList) This results in output that has [] around it, quotes around strings and commas between items More often, the output needs each item without the formatting around it In this case, you need a loop that will process through the list, one element at a time see “Traversing a list” You need either a for loop that presents elements one at a time or a loop that provides the subscript for each element one at a time.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.