i do not understand the third line at all, i tried researching in different places i cant seem to find it anywhere. I know what the len function do, but i do not understand the numbers and the division part of this code. What this code does is returning the middle part of each words.
def middle_char(txt):
return txt[(len(txt)-1)//2:(len(txt)+2)//2]
print(middle_char("Python"))
print(middle_char("PHP"))
print(middle_char("Java"))