Inline if statement:
if x:
y=100
else:
y=20
-
if x: y=100 else y=20
-
x=20 if x else 100
- Correct answer
y=100 if x else 20
Log in to add an explanation.
Advertisement
if x: y=100 else y=20
x=20 if x else 100
y=100 if x else 20
Log in to add an explanation.
Advertisement