I have a problem with my code and I think it's because of my while loop. Can someone help me with it? Sorry if comments are complicated to understand (I added comments in my native language first).
Edit 1: I forget to change taxes variable to kambiyo_yuzde, so it should have been look like this:
The problem is, the while loop doesn't end at value i want to get. For example, when i entered "usd_bolu_tl" "7.500" and "sahip_tl" "2000", value of satis_tl should be 266,67.000 which is 1866.2, and value of deger_tl should be 2004. What i want to calculate with my while loop is that it should add 0.001 value to the "yeni_usd" variable every time it loops and end when satis_tl's value (which is 266.67.000+0.001) is bigger than deger_tl (which is 2004)
kambiyo_yuzde = 2 / 1000
usd_bolu_tl = input("current rate: ")
sahip_tl = input("how much money you have in turkish liras: ")
# money plus taxes
deger_tl = float(sahip_tl) + (float(sahip_tl) * float(kambiyo_yuzde))
print("Bu tl de?erinde dolar alabilmek i?in kambiyo vergisi ile beraber ", deger_tl, "tl ?demeniz gerekir.")
# usd we bought with turkish liras
alinacak_usd = float(sahip_tl) / float(usd_bolu_tl)
# new currency
yeni_usd = 7.000
# selling
satis_tl = float(alinacak_usd) * float(yeni_usd)
while satis_tl < deger_tl:
print("yeni dolarin degeri: ", yeni_usd)
yeni_usd += 0.001
# to profit
print("minimum kar icin dolarinizi satmaniz gereken deger: ", yeni_usd, "'dir.")
input("cikis yapmak icin herhangi bir tusa basiniz.")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…