Question: Python using Idle How Do I align my output to the right without entering a bunch of spaces? in the print command #input Num_Shares=float(input(Enter number
Python using Idle
How Do I align my output to the right without entering a bunch of spaces? in the print command
#input Num_Shares=float(input("Enter number of shares: ")) Stock_Purchase_Price=float(input("Enter purchase price: ")) Stock_Sell_Price=float(input("Enter Selling price: ")) Commission=float(input("Enter Commission: "))
#Calculations paid=Num_Shares*Stock_Purchase_Price Commission_paid_purchase=paid*Commission Sold = Num_Shares * Stock_Sell_Price Commission_paid_Sell=Sold*Commission Profit_Loss=(Sold-Commission_paid_Sell)-(paid+Commission_paid_purchase)
#output print(" Stock Name: Kaplack,. Inc.") print(" Amount paid for the stock: $",format(paid,',.2f')) print("Commission paid on the purchase: $",format(Commission_paid_purchase,',.2f')) print("Amount the stock sold for: $ ",format(Sold,',.2f')) print("Commission paid on the sale: $",format(Commission_paid_Sell,',.2f')) print("Profit (or loss if negative): $ ",format(Profit_Loss,',.2f'))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
