Page 96 - Digicode_AI_class_8
P. 96
3. fruits = ["apple", "banana", "cherry"]
for x in fruits:
print(x)
4. i = 0
while i < 5:
print(i)
i += 1
if i == 3:
break
else:
print(0)
Experiential Learning
Competency-based/Application-based questions Information Literacy
Swara wants to repeat a block of statements for a given number of times, until the control condition is
false. Which type of construct can she use for this?
Critical Thinking
code TASK Interdisciplinary Learning
Write a program to:
1. determine whether a given number is an Armstrong number or not.
2. to print the numbers 8, 11, 14, 17, 20, . . . .
3. print 1 to 100 using while loop.
4. find out the sum of numbers within the range 1 to 100 using while loop.
5. calculate the sum of first ten even numbers by using while loop and for loop.
6. print first 20 odd numbers in decreasing order using while loop.
Leadership & Responsibility
TECH VALUE Initiative
Never steal anyones code.
94 DigiCode AI-VIII

