Yes there is one but you are facing the difficulty because the sytax is not similar to other languages like C, Java etc. and this is the reason the syntax mentioned below is not liked by many programmers.
So it goes like this
# Syntax
# val1 if expr else val2
>>> y = 1
>>> x = 1 if y==2 else 2
>>> print(x)
2
>>> 'true' if True else 'false'
'true'
>>> 'true' if False else 'false'
'false'
Official docs - https://docs.python.org/3/reference/expressions.html#conditional-expressions