0
k = 5 while k <= 100: print("k") k= k+5
why this code just gave me endless ks
9 Antworten
+ 2
the last line should indeted to put it in the loop:
while ..
print ...
k = k+5
+ 2
the statement k = k + 5 is not on the body of the loop possibly. indent it to get it in line with the print statement
+ 2
mugalu then it should be
print(k)
k = k + 5
+ 1
thanks alot now i got it
0
but i din't expect my out put to be the k. i thought it would be
5
10
15
20
25
30
35
40 up to 100 Vedant Bang
0
mugalu Then you should write : print(k)
0
Hey mugalu;
You mustnt do:"k=k+5"
do:"k+=5"
0
Try;
k=5
while k >= 100:
print(k)
k+=5