Heath J
0
Q:

python conditional expression

a, b = 10, 20
# Copy value of a in min if a < b else copy b 
min = a if a < b else b 
1
condition ? expifTrue : expIfFalse;
0
[on_true] if [expression] else [on_false] 
0
a = 1
b = 2
if a < b:
  print("a is less than b") #This will run since 1 is less than 2
elif a > b:
  print("a is greater than b")
else:
  print("a is equal to b")
0

New to Communities?

Join the community