Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code?
x = “abcdef”
i = “a”
while i in x:
print(i, end = ” “)

What will be the output of the following Python code?
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

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

Join The Discussion