I am new to Python and was tasked with making a currency converter today. I wanted to do GBP to Euro, this should be as simple as 100*1.15 if you wanted GBP to turn into Euro. However I found that it wasn't giving me 1.15 as expected and was instead giving me only 114.99999999999999 euros.
GBP = int(input("How many GBP do you hav to exchange?\nTo the nearest whole number"))
#GBP to Euro
def currency(pound):
PtE=input("Are you doing 'GBP to Euro'? (Y/N)")
if PtE == "Y":
newam1 = pound*1.15
print("You now have",newam1,"Euros")
currency(GBP)
that's the code that I wrote, to replicate what happened to me just put 100 and an uppercase Y. I'm sure it's painfully obvious what's gone wrong but it's completely confused me and my mates.