Can you combine two tuples into one dictionary? Update: Answered.
Hi all, I was trying some code in the playground, trying to combine two tuples (I used tuples because I don't think strings would be possible since I thought I'd learned dictionaries can only take immutable data types) into a dictionary, but I can't get it right. Does anyone know how I could get this? Team = ["Jan", "Piet", "Hans", "Henk", "Anne", "Fleur", "Hannah"] Players = ["Player: " + x for x in Team] print(Players) Vast_team = tuple(Players) print(Vast_team) Scores = (81, 36, 72, 24, 55, 56, 12) Wrong_attempt = {Vast_team:Scores} print(Wrong_attempt) This outputs {('Player: Jan', 'Player: Piet', 'Player: Hans', 'Player: Henk', 'Player: Anne', 'Player: Fleur', 'Player: Hannah'): (81, 36, 72, 24, 55, 56, 12)} How can I make a dictionary where I pair the items from "Vast_team" as keys to the items from "Scores" as values? Player_scores = {"Player: Jan : 81, Player: Piet : 36, etc"}? Thnx in advance!