Sail E0 Webinar
Question
What is the output of the following?x = "abcdef"i = "a"while i in x:    x = x[:-1]    print(i, end = " ")
Options:
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
Answer: Option B


The string x is being shortened by one charater in each iteration.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers