a = str(input("введите строку - "))
b = list(a)
c = len(b)
if c % 2 == 1:
a1 = c // 2
print(b[a1])
else:
a1 = c // 2 - 1
a2 = c // 2
print(str(b[a1]) + ' , ' + str(b[a2]))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
a = str(input("введите строку - "))
b = list(a)
c = len(b)
if c % 2 == 1:
a1 = c // 2
print(b[a1])
else:
a1 = c // 2 - 1
a2 = c // 2
print(str(b[a1]) + ' , ' + str(b[a2]))