0
How?i = 3 while i >=0: print(i) i = i - 1 then the answer is 4???
i'm don't understand does the answer must be 3?
19 ответов
+ 5
the answer is 4 because it says while i is geater than or equals 0 (i >= 0)
+ 2
output must be:
3
2
1
0
+ 2
Answer 4 and out put should be
3
2
1
0
Like this 4times
+ 2
I = 3 comment: you have let I to be 3.
while I >= 0 : (u have set while condition to be true in this line)
print(I)
I =I - 1
(this will keep printing I starting from 3 till it reaches 0 I.e decreases by -1.)
output:
first iteration. it will print 3.
2nd iteration. it will print 2. I.e decreases by -1
3rd iteration. it will print 1.
4th iteration. it will print 0 and end d program
+ 1
don't understand either couse
i=i-1 this means 0 - 1=-1 which is not satisfied
i>=0 so my answer is 3
+ 1
On the other hand, when you code;
I = 3
while I >= 0: #You have set while condition to be true
print(I)
The output is;
3
3
3
3
3
3
3
3
3
3
3
3
.
.
.
# Looping forever because the while condition set to be true, until you interrupt the program by pressing Ctrl+C on your Keyboard.
+ 1
4 is the answer
+ 1
How many numbers does this code print?
i = 3
while i>=0:
print(i)
i = i - 1
anser 4
+ 1
I=3
While i>=0:
Print(i)
I=i-1
Answer:
3
2
1
0
It repeats four times.because se should start from 4-1=3
3-1=2
2-1=1
1-1=0
And Bread ejecution
0
The answer is 4
0
The question is the how many iterate the loop so the answer is - 4 times
0
answer = 4
0
answer is 4
0
its ans is
4
- 1
i = 3
while i <0:
i +=1
print(i)
- 1
thx
- 1
i = 3
while i >=0:
print(i)
i = i - 1
result may be:-
3
2
1
0
- 1
the question is how many
- 1
got really confused,i got my answer to be 3