Can I implement a counter using a lambda function in python or some expression more pythonic?
here is my code:
counter = 0
if 0 < arrival_time:
counter += 1
else:
pass
this is what I tried:
count_late = lambda x, arrival_time: x+=1 if 0 < arrival_time else pass
counter_late(counter, arrival_time)
What am I missing or how can I improve this code?
Aucun commentaire:
Enregistrer un commentaire