V

Vaibhav Shukla • 4.53K Points
Extraordinary

Q. What will be the output of the following Python code?

Code:
x = "abcdef"
i = "a"
while i in x:
    x = x[:-1]
    print(i, end = " ")
  • (A) i i i i i i
  • (B) a a a a a a
  • (C) a a a a a
  • (D) none of the mentioned
  • Correct Answer - Option(B)
  • Views: 116
  • Filed under category Python

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics