Single-line if

Report a typo

Consider the code below and find matches between its fragments and the parts of conditional expression.

# positive numbers
print(True) if x >= 0 else print(False)

Match the items from left and right columns
condition
first alternative
second alternative
x >= 0
print(True)
print(False)
___

Create a free account to access the full topic