Hi, I'm working on this piece of code:
numLaptops = 7
laptopCost = 599.50
price = numLaptops * laptopCost
print("Total cost of laptops: $%.2f" % price)
But the question wants me to explain the output if I put 2.5 instead of .2, 8.2 instead of it and 3.1 instead of it too, to me it just looks like .5, .2 and .1 instead of 2.5, 8.2 and 3.1 I don't know what to explain and how to could you give me a hand? Thanks!!
2 answers
The first number before the decimal will be the number of spaces it is indented. For example, if you replace the 2.5 with 8.2, the output will be indented 8 spaces and will show up to 2 decimal places. Hope this helps! :)
Great thanks so much!