Write a function named factors that accepts a positive integer n as argument. It should return the set of all factors of n.
Note that the method to add an element to a set is add and not append.
You do not have to accept input from the user or print anything. You just have to write the definition of the function.
Example
factors(12) -> {1, 2, 3, 4, 6, 12}
factors(7) -> {1, 7}
Implement this function:
def factors(n):
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: n.
Input
12
Output
{1, 2, 3, 4, 6, 12}