Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Exp 3-2 d422 (1)
1. Name of Students Omkar Rane
Roll No D-422
Batch D1
Experiment No EX-3.2
Title of Experiment EX-3.2:Illustratefactorial of non-negativenumbersin Python.
Write An Algorithm:
Step 1: start
Step 2: Define the function fact(no)
Step 3: if (no==1):
Step 4: Else return (no) # returning function
Step 5: else :
Return no*fact*(no-1)
Step 6: Enter Value for factorial “n”
Step 7: Display fact(n)
Step8: Stop
Paste Your Python Program ( Python Code):
def fact(no): # defining function
2. if (no==1):
return (no) # returning value
else:
return no*fact(no-1)
n=raw_input("Enter number")
n=int(n)
p=fact(n)
print p
Paste Your Program OUTPUT :
>>>
120
>>>