Report Bug
Qus :

What will be the output of the following Python code?

 x = "abcdef"
i = "a"
while i in x[:-1]:
    print(i, end = " ")

Qus

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

 x = "abcdef"
i = "a"
while i in x[:-1]:
    print(i, end = " ")


A. a a a a a
B. a a a a a a
C. a a a a a a … infinite Time
D. a


Solution
C. a a a a a a … infinite Time



Explanation
String x is not being altered and i is in x[:-1].



Report Bug