How can I use continue in python ternary? Is that even possible?
E.g.
>>> for i in range(10):
... x = i if i == 5 else continue
give a SyntaxError: invalid syntax
If continue in ternary is possible, is there any other way of doing this:
>>> for i in range(10):
... if i ==5:
... x = i #actually i need to run a function given some condition(s)
... else:
... continue
...
>>> x
5