- 1
Can we use random choice in dictionary?
5 Respostas
+ 3
Without even specifying which programming language you are talking about, your question is too broad. Please tag the language.
If you ask about python, you can pick a random value from a dict like:
random.choice(mydict.values())
0
Yes, you can.
Anyway if you want a meaningful answer, post your code you have trouble with, or ask a more specific question.
0
No no I m generally asking
0
Ok I understand
0
Tibor Santa "dictionnaries" is a good clue that the targeted language is Python, even if the best practice must be to ALWAYS tag question with the relevant targeted language ;)