We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1eaab69 commit 4ddbd40Copy full SHA for 4ddbd40
.DS_Store
0 Bytes
Exercise/Exercise8.py
@@ -0,0 +1,18 @@
1
+'''
2
+Enter a number : 5
3
+Required Output = factorial of 5 is : 120
4
+fill the <x> with your code
5
+5 fill in the blanks
6
7
+ <1> factorial(number):
8
+ if (number<=1):
9
+ return 1
10
+ else:
11
+ return (<2>)
12
+
13
+def main():
14
+ inputNum = <3>(input("Enter a Number : "))
15
+ print("factorial of "+<4>+" is :",<5>)
16
17
+if __name__ == '__main__':
18
+ main()
Solutions/Excercise8.py
@@ -0,0 +1,16 @@
+def factorial(number):
+ return (number*factorial(number-1))
+ inputNum = int(input("Enter a Number : "))
+ print("factorial of "+str(inputNum)+" is :",factorial(inputNum))
0 commit comments