Output is blank
<pre><code>def load():
    name=0
    count=0
    totalpr=0
    name=input("Enter stock name OR -999 to Quit: ")
    while name != '-999':
        count=count+1
        shares=int(input("Enter number of shares: "))
        pp=float(input("Enter purchase price: "))
        sp=float(input("Enter selling price: "))
        commission=float(input("Enter commission: "))
        name=input("Enter stock name OR -999 to Quit: ")

def calc():
    amount_paid=shares*pp
    commission_paid_purchase=amount_paid*commission
    amount_sold=shares*sp
    commission_paid_sale=amount_sold*commission
    profit_loss=(amount_sold - commission_paid_sale) -(amount_paid + commission_paid_purchase)
    totalpr=totalpr+profit_loss

def print():
    print("\nStock Name:", name)
    print("Amount paid for the stock:       $",      format(amount_paid, '10,.2f'))
    print("Commission paid on the purchase: $", format(commission_paid_purchase, '10,.2f'))
    print("Amount the stock sold for:       $", format(amount_sold, '10,.2f'))
    print("Commission paid on the sale:     $", format(commission_paid_sale, '10,.2f'))
    print("Profit (or loss if negative):    $", format(profit_loss, '10,.2f'))
    print("Total Profit is $", format(totalpr, '10,.2f'))

def main():
    load()
    calc()
    print()
</code></pre>

<p>I want to write the main() function to call the functions above it. </p>

<p>However, when I run the program, the output is blank - nothing - there is no error given to elucidate the problem. </p>

<p>What am I doing wrong? </p>

<p>Along with the problem of using built-in function, you've scope problem too. So, you must make the variables defined in each function <code>global</code> so that they can be assessed in other functions.</p>

<pre><code>def load():    
    global name
    global count
    global shares
    global pp
    global sp
    global commission
    name=input("Enter stock name OR -999 to Quit: ")
    count =0
    while name != '-999':
        count=count+1
        shares=int(input("Enter number of shares: "))
        pp=float(input("Enter purchase price: "))
        sp=float(input("Enter selling price: "))
        commission=float(input("Enter commission: "))
        name=input("Enter stock name OR -999 to Quit: ")

def calc():
    global amount_paid
    global amount_sold
    global profit_loss
    global commission_paid_sale
    global commission_paid_purchase
    global totalpr
    totalpr=0
    amount_paid=shares*pp
    commission_paid_purchase=amount_paid*commission
    amount_sold=shares*sp
    commission_paid_sale=amount_sold*commission
    profit_loss=(amount_sold - commission_paid_sale) -(amount_paid + commission_paid_purchase)
    totalpr=totalpr+profit_loss

def display():
    print("\nStock Name:", name)
    print("Amount paid for the stock:       $",      format(amount_paid, '10,.2f'))
    print("Commission paid on the purchase: $", format(commission_paid_purchase, '10,.2f'))
    print("Amount the stock sold for:       $", format(amount_sold, '10,.2f'))
    print("Commission paid on the sale:     $", format(commission_paid_sale, '10,.2f'))
    print("Profit (or loss if negative):    $", format(profit_loss, '10,.2f'))
    print("Total Profit is $", format(totalpr, '10,.2f'))

def main():
    load()
    calc()
    display()

main()
</code></pre>

python function python-3.x calling-convention