Question
What is the output of the following?x = "abcdef"i = "a"while i in x: x = x[:-1] print(i, end = " ")
Answer: Option B
Was this answer helpful ?
The string x is being shortened by one charater in each iteration.
Was this answer helpful ?
Submit Solution