# Purpose: Tax input amount
#          
#-----------------------------------------------------------------------
# VARIABLE DEFINITIONS
salesAmount= 0.0
salesTax=0.0
total=0.0
#-----------------------------------------------------------------------
# CONSTANT DEFINITIONS

#-----------------------------------------------------------------------
# FUNCTION DEFINITIONS

#-----------------------------------------------------------------------
# PROGRAM'S MAIN LOGIC
salesAmount = float (raw_input("Enter the sales amount:"))
salesTax = float(salesAmount*0.08)   
total = salesAmount + salesTax 

print "The sales amount is $", salesAmount
print "The sales tax is $",salesTax
print "The total sale is $",total 


raw_input("\nRun complete. Press the Enter key to exit.")

i know you have to add \n but ive tried putting it everywhere

Edited 3 Years Ago by Fernando_1

print "The sales amount is $\n\n", salesAmount
or
print "The sales amount is $", 2*'\n', salesAmount

Edited 3 Years Ago by misokolsky: change Bold to Inline Code

print(2*'\n')

at line 19 before results.

Or change the line 20

print "\n\nThe sales amount is $", salesAmount

Edited 3 Years Ago by pyTony

You can aslo use the WYSIWYG approach to format your output ...

# Purpose: Tax input amount
#          
#-----------------------------------------------------------------------
# VARIABLE DEFINITIONS

#-----------------------------------------------------------------------
# CONSTANT DEFINITIONS

#-----------------------------------------------------------------------
# FUNCTION DEFINITIONS

#-----------------------------------------------------------------------
# PROGRAM'S MAIN LOGIC
salesAmount = float (raw_input("Enter the sales amount: "))
salesTax = salesAmount*0.08   
total = salesAmount + salesTax 

# create a formatted result string with % modifiers
# %0.2f --> formats float to 2 decimals
# what you see is what you get (WYSIWYG)
sf = """\


The sales amount is $%0.2f
The sales tax is $%0.2f
The total sale is $%0.2f

"""
print sf % (salesAmount, salesTax, total)

raw_input("Run complete. Press the Enter key to exit.")

Edited 3 Years Ago by vegaseat

This question has already been answered. Start a new discussion instead.