-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2DList.py
More file actions
21 lines (15 loc) · 853 Bytes
/
Copy path2DList.py
File metadata and controls
21 lines (15 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#There can be to type of 2D declation
#fruits = ["Apple", "Orange", "Banana"]
#vegetables = ["Celery", "Carrots", "Potatoes"]
#meats = ["Beef", "Chicken", "Pork"]
#groceries = [fruits, vegetables, meats]
#groceries = [["Apple", "Orange", "Banana"], ["Celery", "Carrots", "Potatoes"], ["Beef", "Chicken", "Pork"]] #List of list
#groceries = [("Apple", "Orange", "Banana"), ("Celery", "Carrots", "Potatoes"), ("Beef", "Chicken", "Pork")] #List of Tuple
#groceries = ({"Apple", "Orange", "Banana"}, {"Celery", "Carrots", "Potatoes"}, {"Beef", "Chicken", "Pork"}) #List of Sets
groceries = (("Apple", "Orange", "Banana"), ("Celery", "Carrots", "Potatoes"), ("Beef", "Chicken", "Pork")) #Tuple of Tuples
#print(groceries)
#Nested Loop
for collection in groceries:
for food in collection:
print(food, end=" ")
print()