C++
<condition> ? <if true return> : <else return>
Python
<if true return> if <condition> else <else return>
example:
rsl = f[len(prefix):] if f.startswith(prefix) else f
https://mail.python.org/pipermail/python-list/2010-July/581933.html