def flip_coin(game, thing):
  if not "coin" in game.player.inventory:
    game.output("The coin is on the ground!")
    return
  if random.random() > 0.5:
    game.output("The coin shows heads.");
  else:
    game.output("The coin shows tails.");

# Note that we need to return after outputting the message "The coin is on the ground",
# otherwise we will continue on to show one the message about heads or tails which wouldn't
# make sense!

# Now let's add the phrase:
dataset/ETHPy150Open gever/bwx-adventure/tutorial2.py/flip_coin/original