Home > OS >  typeError while adding items to list through a function
typeError while adding items to list through a function

Time:06-25

so currently im working on a function where you add countries you visit, times visited and cities visited to a list however whenever i add the arguments to the list through the function i get a type error

here is my code ps: im still learning and the requirements are that i have to add the items through a function

code

travel_log = [
{
  "country": "France",
  "visits": 12,
  "cities": ["Paris", "Lille", "Dijon"]
},
{
  "country": "Germany",
  "visits": 5,
  "cities": ["Berlin", "Hamburg", "Stuttgart"]
},
]
#           
  • Related