Factorial Program in Python for class 12th
Factorial Program in Python for class 12th |
Today I Mohit Gupta of class 12th give you a fundamental question of the board examination of class 12th Computer Science new in which you can get the Program related to the Python Programming So if you are interested in getting the Important question and Programs that definitely appears in the board examination of class 12ths stay tune with this article and read and understand the Program carefully.
If you are in class 12th, you know that computer science new is the newly introduced in for the 11th class students in which you can learn all about the new programming language that is Python.
Following are the Important Programs that also appear in board examination check out these too:-
Things to remember while writing a program:-
1. You have to use proper syntax and write indentation
2. Use the comments properly after every statement
Program of Factorial is given below using recursion:-
def factorial(n):
return 1
if (n==1 or n==0)
else n * factorial(n - 1):
#_Main_
num = int(input("enter any natural no.")
print("Factorial of",num,"is", factorial(n))
factorial(num))
No comments:
Post a Comment