Suggest the python code for detecting the position of a character in a string.
String: "Hello World!"
Character: "!"
def position_of_char(string, char):
    '''This function will detect the position of a character in a string.'''
    return string.index(char)