PYTHON TASK
- Five students enter the classroom one after another. The first student gets roll number 1, the second gets 2, and so on. Display the assigned roll numbers.
Level 1 :
print(1,2,3,4,5)
Level 2:
student=1
while student<=5:
print(student)
student=student+1
output:
1
2
3
4
5
- A coach asks students to stand only at even-numbered positions in a queue. Display the first five positions.
Level 1:
print(0,2,4,6,8)
Level 2:
for i in range (0,10,2):
print(i)
output:
0
2
4
6
8
- A newly constructed building has a special lift that does not stop on every floor. For safety reasons, it stops only at every third floor. A person enters the lift at the ground floor and presses the "Up" button. Display the first five floors where the lift will stop.
Level 1:
print(3,6,9,12,15)
Level 2:
floor=3
while floor<=16:
print(floor)
floor=floor+3
output:
3
6
9
12
15
- A rocket launches with a countdown using only even numbers from 10. Display the countdown.
Level 1:
print(10,8,6,4,2,0)
Level 2:
for i in range(10,-1,-2):
print(i)
count=10
while count>=0:
print(count)
count=count-2
output:
10
8
6
4
2
0
Top comments (0)