examples/basics/short_circuit.py
from __future__ import print_function
import sys

if len(sys.argv) != 3:
    exit("Usage: " + sys.argv[0] + " money salary")

money  = int(sys.argv[1])
salary = int(sys.argv[2])

def money_in_bank():
    global money
    money += salary
    return money > 1000000

def good_salary():
    global salary
    salary += 1
    return salary >= 1000

if money_in_bank() or good_salary():
    print("I can live well")

print("I have")
print("Salary: ", salary)
print("Money:  ", money)

# $ python examples/basics/short_circuit.py 100000 100
# I have
# Salary:  101
# Money:   100100

# $ python examples/basics/short_circuit.py 1000000 100
# I can live well
# I have
# Salary:  100
# Money:   1000100

17 checking if can_vote
19 checking if can_vote
19 checking if can_buy_alcohol
24 checking if can_vote
24 checking if can_buy_alcohol
24 To old to rock-and-roll