Why i can't do calculations in loops | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why i can't do calculations in loops

print("kwota wprowadzana") x=float(input()) print (" procent skladany") y=float(input()) print ("na ile dni") z=int(input()) while i<z: x=x+x*(y/100) i=i+1 if i==z:break print(x) Compiler shows at x and saying expected na intended block but i dont know why.Can anybody explain this to me?

13th Feb 2022, 1:06 PM
papcio papcio
papcio papcio - avatar
3 Respostas
+ 2
OMG that was that easy. Thanks a lot.
13th Feb 2022, 1:47 PM
papcio papcio
papcio papcio - avatar
+ 1
I love how modern computer languages tell you whatā€™s wrong with the code and what line itā€™s inā€¦makes life much easieršŸ˜…
14th Feb 2022, 2:17 PM
Andrew Johnson
Andrew Johnson - avatar
0
Ok i understand that "if" here Has no point but how i can intend lines in loop ? Using {} or what ?
13th Feb 2022, 1:21 PM
papcio papcio
papcio papcio - avatar