Difference between revisions of "Python-lists"

From wikipost
Jump to navigationJump to search
Line 35: Line 35:
 
blue
 
blue
 
</pre>
 
</pre>
 +
 +
 +
===2 dimensions===

Revision as of 15:10, 17 December 2020

parsing lists in python


just numbers

my_list = [28, 56, 45]

for item in my_list:
  print(item)

Output:

28
56
45


just words

my_list = ["green", "red", "blue"]

for item in my_list:
  print(item)

Output:

green
red
blue


2 dimensions