Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ganesh-Chandran005 authored Dec 20, 2024
1 parent e7b4b6a commit c8a1e49
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Day-17/GANesh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
def factorial(n):
if n==1:
return n
else:
return n * factorial(n-1)
n=int(input("Enter a Limit:"))
print(factorial(n))



def fibo(n):
if n == 0:
return 0
if n == 1:
return 1
return fibo(n - 1) + fibo(n - 2)


n=int(input("Enter the limit:"))
print("Fibonacci number:",fibo(n))


def add(n1,n2):
if n2==0:
return n1
else:
return add(n1+1,n2-1)
n1=int(input("Enter number 1:"))
n2=int(input("Enter number 2:"))
print("Sum of",n1,"And",n2,"is",add(n1,n2))

0 comments on commit c8a1e49

Please sign in to comment.