Unlike C++, we don’t have ?: in Python, but we have this :
[on true] if [expression] else [on false]
If the expression is True, the statement under [on true] is executed. Else, that under [on false] is executed.
Below is how you would use it :
>>> min=a if a<b else b
Output : 2
>>> print("Hi") if a<b else print("Bye")
Output : Hi