+ 1

please find out why an error occurs in my code

sportsman = {"football": 'Messi', 'Ronaldo', "tennis": 'Federer', 'Nadal'} print(sportsman)

1st Aug 2019, 6:45 AM
Марсель Халимов
3 odpowiedzi
+ 5
A key can have only one value. If you have more you need to use a tuple
1st Aug 2019, 6:54 AM
Helena
Helena - avatar
+ 3
sportsman = {"football": {'Messi', 'Ronaldo'} , "tennis":{ 'Federer', 'Nadal'}} print(sportsman)
1st Aug 2019, 6:51 AM
Gordon
Gordon - avatar
+ 2
Thanks
1st Aug 2019, 6:52 AM
Марсель Халимов