Why i can't do calculations in loops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
+ 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