MaliciousKebab@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-211 months agoNeed a rust version too.toggl.comimagemessage-square90fedilinkarrow-up1856arrow-down135
arrow-up1821arrow-down1imageNeed a rust version too.toggl.comMaliciousKebab@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-211 months agomessage-square90fedilink
minus-squarescratchresistor@thelemmy.clublinkfedilinkarrow-up93arrow-down1·11 months agoPython: from Rescues import Princess Princess.rescue()
minus-squarebob_lemon@feddit.delinkfedilinkarrow-up26·11 months agomap(lambda princess: princess.rescue(), [castle.get_princess() for castle in castles])
minus-squarescratchresistor@thelemmy.clublinkfedilinkarrow-up7·11 months agoDon’t forget to keep your return values… rescued_princesses = [{"princess": princess, "rescued": princess.rescue()} for princess in [castle.get_princess() for castle in castles]]
Python:
from Rescues import Princess Princess.rescue()
map(lambda princess: princess.rescue(), [castle.get_princess() for castle in castles])
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]]
from Castle import Princess
Done