This is my first week at college (Cyber security), and I don't have any coding background.
For a python assignment, I have to round the amounts to two decimal places, but if the last decimal is a zero, it should not show in the output. What is the appropriate rounding code I should use?
This is my code:
if (valuta == 1): print("Voor", bedrag, "US Dollar krijgt u ", round(USDollar,2),"Euro, De transactiekosten bedragen", round(DollarTransactiekosten,2), "Euro. U ontvangt",round(AfgerondDollar,2), "Euro" )
Edit: Thanks for all the answers and help guys