Many languages have a "ternary operator," allowing you to express a condition and an expression in a short form. In this video, I answer a question from a subscriber to my "Better developers" newsletter (https://BetterDevelopersWeekly.com/), in which he says that you can have conditions in lambdas in this way. My response? You're right, but it's so unreadable, do you want to?
Watch video Does Python have a ternary (?:) operator? Conditional expressions in Python, and when to use them online, duration hours minute second in high quality that is uploaded to the channel Python and Pandas with Reuven Lerner 26 August 2020. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,521 times and liked it 55 visitors.