def add_extension(file_name, ext='py'):
    """
    adds an extension name to the file_name.
    :param file_name: <str> the file name to check for extension.
    :param ext: <str> add this extension to the file name.
    :return: <str> file name with valid extension.
    """
    if not file_name.endswith(ext):
        return file_name + '.{}'.format(ext)
    return file_name