Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lists in Python Outputting lists.

Similar presentations


Presentation on theme: "Lists in Python Outputting lists."— Presentation transcript:

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.


Download ppt "Lists in Python Outputting lists."

Similar presentations


Ads by Google