13 lines
246 B
Python
13 lines
246 B
Python
order_total = 247 # GBP
|
|
|
|
# classic if/else form
|
|
if order_total > 100:
|
|
discount = 25 # GBP
|
|
else:
|
|
discount = 0 # GBP
|
|
print(order_total, discount)
|
|
|
|
# ternary operator
|
|
discount = 25 if order_total > 100 else 0
|
|
print(order_total, discount)
|