Python Forum
Store a set in a dictionary's value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Store a set in a dictionary's value
#7
In line 4 you're creating a single set and trying to use it later. But every team need their own set. So you have to create it when it doesn't exist, and you don't need to keep track of it outside the dict.

In line 7, your dict value should already be a set. You want to modify that value (with add() method, not replace the value with something else.

Inn line 9, you need to create a (new) set, not reference a previously created one.
Reply


Messages In This Thread
RE: Store a set in a dictionary's value - by bowlofred - Oct-05-2020, 10:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Read csv file, parse data, and store in a dictionary markellefultz20 4 4,743 Nov-26-2019, 03:33 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020