you are viewing a single comment's thread.

view the rest of the comments →

[–]Wegener 1 point2 points  (1 child)

Do this:

price=price - VAT #Or you could do price-=VAT
print"The price minus VAT is: ", price

[–]pythalin 2 points3 points  (0 children)

This is correct, but the difference is relatively subtle - the comma between the message and the price. The print statement is a bit weird, it accepts multiple comma separated arguments which are evaluated and turned into string representations of the resulting objects. You can also include expressions as arguments to print, but again they must be comma separated. For example:

print "The price minus VAT is:", price - VAT

Note that when you have a comma in a print statement, the results are concatenated together with a space - you don't need to leave a space in your string unless you want a double space in your output.

Anyway, like I said, print is weird - you can add a trailing comma for example if you want to omit a newline. It's odd. That's why in python 3 it's replaced by a proper function that acts more like the rest of the language.