edited by
197 views
0 votes
0 votes

IB JIO Grade-2 Tech 2023 part-2-75

Q.75 What is the output of the following part of Python program?

c=0
while(c<=2):
    c=c+1
    print("Hi")



Ans
1. Hi
2. $\mathrm{Hi}$
3. $\mathrm{Hi} \mathrm{Hi} $
4. $\mathrm{Hi}$
$\mathrm{Hi}$
Question ID : 630680278531
Option 1 ID : $\mathbf{6 3 0 6 8 0 1 0 8 2 4 0 9}$
Option 2 ID : 6306801082411
Option 3 ID : 6306801082412
Option 4 ID : $\mathbf{6 3 0 6 8 0 1 0 8 2 4 1 0}$
Status : Answered
Chosen Option : 3

edited by

1 Answer

1 votes
1 votes
while loop runs $3$ times, each time variable $c$ is incremented by $1$. if we see the indentation sign both the statements are from a single block only, so every time when $c$ is incremented each time the print function prints the message.

So the output is  $\text{HiHiHi}$

Option $(2)$ is correct.

Related questions

164
views
1 answers
0 votes
admin asked Jul 31, 2023
164 views
Q.17 What is the output of the following part of python program?\[\begin{array}{l}\mathrm{s}=\text { "india" } \\\mathrm{l}=0\end{array}\]for $\mathrm{x}$ ... Option 4 ID : 6306801082408Status : AnsweredChosen Option : 4
435
views
1 answers
0 votes
admin asked Jul 31, 2023
435 views
Q.18 Which of the following function in python is used to read keyboard input?Ans1. scanf2. input3. gets4. $\operatorname{cin}$Question ID ... 3 ID : 6306801082419Option 4 ID : 6306801082420Status : AnsweredChosen Option : 2
102
views
0 answers
0 votes
admin asked Jul 31, 2023
102 views
Q.1 Which statement is FALSE regarding Programmable Logic Controller?Ans1. PLC is a specialized Programmable device which is used to control machines and ... : 6306801082179Option 4 ID : 6306801082180Status : Not AnsweredChosen Option : --
133
views
0 answers
0 votes
admin asked Jul 31, 2023
133 views
Q.2 Which probability distribution is most widely used to model quantization noise in pulse code modulation?Ans1. Poisson2. Bernoulli3. Uniform4. ... ID : 6306801082321Option 4 ID : 6306801082322Status : AnsweredChosen Option : 1