Yes, python does have a ternary operator. It allows to quickly test a condition instead of a multiline if statement. You can specify ternary operator like this: condition_is_true if condition else condition_is_false
Have a look at the following example.
>>> for idx in range(1,119,10):... e=idx+9 if idx+9<=119 else 119... print(e)...102030405060708090100110119