Editor settings

General settings

Save settings

Learn to program with Python

Create a grocery list #

Try and create a nested list for your grocery shopping. All the elements in the list should also be a list where the first element is the name of the item, and the second element of the list is the amount.

For example:

my_grocery = [
    ["Apple", 1],
    ["Banana", 10],
]

Exercise #

  • Create a variable my_grocery for your grocery shopping list
  • The list should have at least 5 elements (5 items you need to buy)
  • The first element of the sub-elements is the item name of type string
  • The second element of the sub-elements is the amount of type int
Output will be displayed here