Redemption Questions & Answers
0 1 2 3 4 - ANSWERSWhat is the output?
for i in range (5):
..print(i, end = " ")
time time time - ANSWERSWhat is the output?
for x in range (3):
..print("time", end = " ")
12 - ANSWERSWhat is the output?
j=0
while j < 10:
..j+=3
print(j)
s
e
p
t
e - ANSWERSWhat is the output?
word = "september"
for let in word:
..if let != "m":
....print(let,)
..else:
....break
---
---
--- - ANSWERSWhat is the output?
x=3
while x > 0:
..y = 3
..while y>0:
....print("-", end = " ")
....y-=1
..x-=1
print()
condition - ANSWERSWhat is the term for x called?
while(x)
, while - ANSWERSA _______ loop is a block of code associated with a condition. As
long as the condition is true, the loop will continue to run the block of code.
0
1
2
3
4 - ANSWERSWhat is the output?
x=0
while(x<5):
..print(x)
..x+=1
20
16
12
8
4 - ANSWERSWhat is the output?
x = 20
while(x>0):
..print(x)
..x=x-4
While - ANSWERS_______ loops repeat code as long as a condition is true
4
915
5
91 - ANSWERSWhat is the output?
num=9154
print(num%10)
print(num/10);
num/=10
print(num%10)
print(num/10)
4
5
1
9 - ANSWERSWhat is the output?
number=9154
while(number>0):
..print(number%10)
..number=number/10