Now we take another example of finding the factorial of a given number using the function factorial. Now here in this example, you can see I'm using an online Python compiler to code compile run debug online. So we are writing it, and then we are pressing run to execute the program. So here you can see the Python program. Hash indicates remarked that factorial n, where n is the input supplied as an argument to the function, single line factorial returned one if n is equal to one or n is equal to zero because the factorial of one and zero remains one as n multiplied by factorial n minus one continues. So when I'm talking about n is equal to six, and then then factorial of num is we call the function factorial now And here, I do run.
So execution takes place. And here we get factorial of six is 720. Similarly, we can take a smaller number, say four. And now we can run it with the value four. So the factorial of four is 24. So this is how we can find the factorial of a number, using Python through the defined function format.