python program to calculate the factorial of a given number n