Published
- 1 min read
is there a replacement for ternary operator in python
The solution for this is noted below
is there a replacement for ternary operator in python
Solution
>>> a = 10
>>> b = 5
>>> largest = a if a > b else b
>>> print(largest)
Try other methods by searching on the site. That is if this doesn’t work