Please support our Python advertiser: Programming Forums
Views: 3457 | Replies: 2
![]() |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Rep Power: 4
Solved Threads: 0
here below is my code
this statement is not behaving in the way I think it would
why is it adding a space after the "$" character like below
I would think it would be like this
not
#!/usr/bin/python
#this is my third python script
print \
"""
this is a python program to figure out total sales price, including tax\n\n
\t\t\tprogrammed by\n
\t\t\tShane Lindberg\n\n
"""
base_price=int(raw_input("please enter the base price of the car:\n$"))
under_coat=int(1000)
stereo=int(200)
air=int(750)
tax=int(base_price*.07)
print "the total price of the car with all extras and tax is: $",base_price+under_coat+stereo+air+taxthis statement is not behaving in the way I think it would
print "the total price of the car with all extras and tax is: $",base_price+under_coat+stereo+air+tax
please enter the base price of the car: $20000 the total price of the car with all extras and tax is: $ 23350
I would think it would be like this
$23350
$ 23350
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode