Question 4 - Week 4 Practice | Prasnya
Prasnya
Continue with Google
Practice path
Dashboard
Exam
Qualifier / Quiz 1
Go to subject
Programing with python
Go to chapter
Week 4
Question 4
00:00
Est. 1 min
Marks:
+3.00
0.00
Write a `while` loop to print the first
100
100
powers of
3
3
, one on each line. The
i
i
-th line should have the value of
3
i
3^i
. The output has
100
100
lines in total. The first five lines look like this: ``` 3 9 27 81 243 ```
Single correct
Easy Difficulty
23 February 2025
A
``` n = 1 while n < 100: print(3 ** n) ```
B
``` n = 1 while n < 100: print(3 ** n) n = n + 1 ```
C
``` n = 1 while n <= 100: print(3 ** n) n = n + 1 ```
D
``` n = 1 while n < 100: n = n + 1 print(3 ** n) ```