input len while if and break elif and break else print for in range if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
a = input()
k = 0
h = 0
l = len(a)
i = 1
while 0 < i < l:
if a[i - 1] != a[l - i] and a[i - 1] == a[l - i - 1]:
k = l - i + 1
a = a[:(l - i)] + a[(l - i + 1):]
l -= 1
break
elif a[i - 1] != a[l - i] and a[l - i - 1] == a[i - 1]:
k = i
a = a[:i - 4] + a[i - 3:]
l -= 1
break
else:
i += 1
print(a)
for i in range(l):
if a[i] != a[l - i - 1]:
h = 1
if h == 1:
print(0)
else:
print(k)