random choice dictionary python

Solutions on MaxInterview for random choice dictionary python by the best coders in the world

showing results for - "random choice dictionary python"
Anna
09 Jun 2019
1dict = { 'A' : 1, 'A' : 2, 'A' : 3}
2
3random_element = random.choice(list(dict.items())
4# Output = (key, value)
5
Fernando
20 Mar 2020
1deck = {
2    'King':10,
3    'Queen':10,
4    'Valete':10}
5
6random.choice(list(deck.keys()))