import math


def factors(x):
    """
    Returns list of distinct factors of x
    """
    factors_list = []
    if x % 2 == 1:
        step = 2
    else:
        step = 1
    for i in range(1, round(math.sqrt(x)) + 1, step):
        if x % i == 0:
            if i**2 == x:
                factors_list.append(i)
            else:
                factors_list.extend([i, x//i])
    return(factors_list)