def has_extension(string, exts):
    """Returns true/false if a string (supposedly a filename) has an extension or not.
    F.ex: index.html has_extension html -> True. hello.pdf has_extension txt -> False"""
    if (isinstance(exts,str)):
        exts = [exts]
    has_extension = False
    for ext in exts:
        if (ext[0] != "."):
            ext = "." + ext
        if (string[-len(ext):] == ext):
            has_extension = True
    return has_extension