I'm only a few days in to learning Python, so please bear with me. I need to line up the decimals on the printed information but I cannot get the text to look uniform at all.
Here is my code: def main(): # Set up constants for cost per yard, flat fee, and tax rate cost_carpet = 5.50 fee = 25 tax = .06 # Ask for yards needed yards_needed = float(input('Please enter the total number of yards needed ')) # Calculate subtotal subtotal = yards_needed * cost_carpet + fee # Calculate tax_rate tax_rate = subtotal * tax # Calculate total_due total_due = subtotal + tax_rate # Print blank line print() # Print infomation print("The cost of the carpet is $", format(subtotal,'9,.2f')) print("The flat fee is $", format(fee,'9,.2f')) print("The tax is $", format(tax_rate,'9,.2f')) print("The total due is $", format(total_due,'9,.2f')) main () Thank you in advance, Jenny
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor