Valerie Meunier

Valerie Meunier

  • 954
  • 693
  • 72.6k

print shows nothing but the text

Mar 18 2023 2:54 PM

Hi

the print shows only the text, but not the result.

This works= print(topay)

Thanks for help.

import datetime
begdat = input("begindate (dd-mm-jj): ")
enddat = input("enddate in (dd-mm-jj): ")
db=datetime.datetime.strptime(begdat,"%d-%m-%y").date()  
de=datetime.datetime.strptime(enddat,"%d-%m-%y").date()  
x=int(input("amount persons: "))
d=de-db
topay=(d.days + 1) * 15 * x
print(("You have to pay: ").format(topay)) # only text is shown


Answers (3)