What will be the output of the following code if the input is A
(ii) bccabc
string = raw_input(“Enter a string:”)
count = 3
while true:
if string[0] == ‘a’:
string = string[2:]
elif string[-1] == ‘b’:
string = string [:2]
else:
count+=1
break
print string
print count
Answer:
Output:
bccabc
4