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

Tuhin PaulRank #7 · 71.9K reputationPosted Mar 18, 2023, 2:27 PM EDT
Instead of using "You have to pay: ", you should use "You have to pay: {}" so that the result of topay gets inserted into the string.
Try changing the last line to:
print("You have to pay: {}".format(topay))Tuhin PaulRank #7 · 71.9K reputationPosted Mar 18, 2023, 2:26 PM EDT
I think you're missing the placeholder in the format string for the
topayvariable..Valerie MeunierRank #1,527 · 1K reputationPosted Mar 18, 2023, 5:54 PM EDT
Yes, of course. Stupid question. Thanks