Skip to main content
The 2024 Developer Survey results are live! See the results
deleted 3 characters in body
Source Link
pt12lol
  • 2.4k
  • 1
  • 24
  • 48

You can use dict comprehension. Take a look below:

TEAMS = [u'New Zealand', u'USA']
dictd = {team: 'Rugby' for team in TEAMS}

You can use dict comprehension. Take a look below:

TEAMS = [u'New Zealand', u'USA']
dict = {team: 'Rugby' for team in TEAMS}

You can use dict comprehension. Take a look below:

TEAMS = [u'New Zealand', u'USA']
d = {team: 'Rugby' for team in TEAMS}
Source Link
pt12lol
  • 2.4k
  • 1
  • 24
  • 48

You can use dict comprehension. Take a look below:

TEAMS = [u'New Zealand', u'USA']
dict = {team: 'Rugby' for team in TEAMS}