Answer:
The program to this question can be given as:
Program:
Number=int(input("Insert a number :")) # input a number from
fact=[] # crate list
for k in range(1,Number+1): #loop
if Number%k==0: # check number is divisible by k
fact.append(k)
print ("Factors of {} = {}".format(Number,fact)) #print value
Output:
Enter a number: 4
Factors of 4= [1,2,4]
Explanation:
In the above python program firstly we declare a variable that is Number in this variable we take user input. To user input, we first convert the value into the integer and the input function is used for input. Then we declare a list that fact =[]. In the python, the list is used for placing all the elements inside a square bracket [ ] all the elements will be separated by commas. Then we use for loop it is used for iterate over a sequence. Then we use the if statement. It is used for check condition. In this statement, the number is divided by k. if the remainder is equal to 0. It will print the value.