I want to write the print output from the math to a text file but I can't make it work.
This is my code:
huur = int(input("Hoeveel bedraagt de huur per jaar? "))
percentage = int(input("Percentage verhoging elk jaar: "))/100
tijd = int(input("Hoeveel jaar wordt de opslagruimte gehuurd? "))
x = 0
while x < tijd:
huur += huur * percentage
x += 1
print(f"Kosten huur jaar" ,x, huur,)
I tried it with with open("uitvoer.txt", "w") as f:
f.write(f"result: {print}")
but it didn't work.