The function takes an input string and outputs one or two characters from the middle of the string. If the input string has an odd length, it returns the middle character; if the input string has an even length, it returns the two middle characters.

[CODE]: 
```
def middle_chars(input_string):
    length = len(input_string)
    middle = length // 2

    if length % 2 == 0:
        return input_string[middle - 1] + input_string[middle]
    else:
        return input_string[middle]
```