Discussion :: Python MCQs
-
What is the output of the following?x = "abcdef"i = "a"while i in x:x = x[:-1]print(i, end = " ")
Answer : Option B
Explanation :
The string x is being shortened by one charater in each iteration.
Be The First To Comment