you are viewing a single comment's thread
view the rest of the comments
[–] 27 points 2 years ago (1 child)

map(lambda princess: princess.rescue(), [castle.get_princess() for castle in castles])

  • source
  • parent
  • hideshow 1 child comment
  • [–] 7 points 2 years ago

    Don't forget to keep your return values...

    rescued_princesses = [{"princess": princess, "rescued": princess.rescue()} for princess in [castle.get_princess() for castle in castles]]

  • source
  • parent