(a++ if a==b else b++) + 1
Or something like this (borrowed from https://stackoverflow.com/questions/65024477/walrus-operator...): from datetime import datetime
timestamps = ['30:02:17:36', '26:07:44:25',
'25:19:30:38','25:07:40:47']
timestamps_dt = [
datetime(days=day,hours=hour,minutes=mins,seconds=sec)
for i in timestamps
day,hour,mins,sec := i.split(':')]
But this type of stuff is always greeted with Python's inflexible syntax. Recently, I learnt about Rackets's idea that "everything is expression" on (https://beautifulracket.com/appendix/why-racket-why-lisp.htm....) and was blown away to realize these are valid Racket codes: ((if (< 1 0) + *) 42 100)
or (+ 42 (if (< 1 0) 100 200))
The second one has an equivalent in Python: 42 + (100 if 1 < 0 else 200)
But the first one does not: 42 (+ if 1 < 0 else *) 100
> SYNTAX ERROR.Maybe it's time for me to get my hands dirty with Lisp.