Create a Python function for padding a string with a given character upto a specific length.
def pad_string(string, character, length):
    padded_string = string 
    while len(padded_string) < length:
        padded_string = character + padded_string
    return padded_string