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].
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad