Report Bug
Qus :

What will be the output of the following Python code?

x = "abcdef"
i = "a"
while i in x:
    print(i, end = " ")

Qus

निम्नलिखित Python कोड का आउटपुट क्या होगा?

x = "abcdef"
i = "a"
while i in x:
    print(i, end = " ")


A. no output
B. i i i i i i …
C. a a a a a a …
D. a b c d e f


Solution
C. a a a a a a …



Explanation
As the value of i or x isn’t changing, the condition will always evaluate to True.



Report Bug