diff --git a/Algorithms/Python/Fibonacci.py b/Algorithms/Python/Fibonacci.py new file mode 100644 index 0000000..ddeef2e --- /dev/null +++ b/Algorithms/Python/Fibonacci.py @@ -0,0 +1,16 @@ +def Fibonacci(n): + if n <= 1: + return n + else: + return (Fibonacci(n-1) + Fibonacci(n-2)) + + + + + +while(1): + N = int(input("enter an integer: ")) + if N == -1: + break + + print( Fibonacci(N)) diff --git a/Algorithms/Python/sum_cubes.py b/Algorithms/Python/sum_cubes.py new file mode 100644 index 0000000..aa696fa --- /dev/null +++ b/Algorithms/Python/sum_cubes.py @@ -0,0 +1,13 @@ +def sumcube(no): + if(no == 1): + return 1 + else: + return(no * no * no + sumcube(no - 1)) + + +while(1): + n = int(input("enter the number : ")) + if(n == -1): + break + print(sumcube(n)) +