Write a Python code to find the factorial of a given number without using inbuilt functions like factorial().
num = 6
def factorial(num): 
    if num == 0: 
        return 1 
  
    return num * factorial(num - 1) 
  
num = 6
print("Factorial of", num, "is", factorial(num))