#๐Ÿ”’ Random function for 2 key in dictionary

10 messages ยท Page 1 of 1 (latest)

plucky nebulaBOT
#

@grand forum

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

unborn terrace
#

what error do you get?

minor charm
#

do you want the name of the enemy, it's properties or both?

karmic igloo
#

random.choice(enemy.values())
Will pick a random dictionary entry, but to get the enemy name you should put it in the enemy object as a property.

minor charm
minor charm
#

@grand forum why even remove the text of the initial post?
if you solved the problem or gotten an answer you can !close the thread but let the text remain, it might help someone else

rose jasper
plucky nebulaBOT
#
Python help channel closed

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.