I'm fairly new to programming and after learning loops in python I tried making my version of a function that gives me the factorial of the number entered. I know one way is to do it by using recursion but I've been trying to use only loops for the same. The problem is that the code I've managed to come up with doesn't multiply the results of each iteration. Here's the code:
def myfactorial(k):
t = 1
while t<=(k-1):
print(k*(k-t))
t = t+1
myfactorial(7)
and here's the output: 42 35 28 21 14 7
thanks :)