Recursion in Python | Python Tutorial - Day #30

preview_player
Показать описание
Python is one of the most demanded programming languages in the job market. Surprisingly, it is equally easy to learn and master Python. This python tutorial for absolute beginners in Hindi series will focus on teaching you python concepts from the ground up.

python, C, C++, Java, JavaScript and Other Cheetsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

Thanks! Harry Sir Passing My BCA/MCA exams through your videos as my college faculty takes 60k per year but still not explaining 10% of your playlist. Thankyou so much. Here I am giving u a very very small thanks amount as i am not earning anything but respect to you from the bottom of my heart.

aayushkotecha
Автор

This video was recorded on Monday 19Th december. So much in advance. This shows your hardwork in making these videos.

VinodSharma-fgjq
Автор

program to print fibbonacci sequence:

def fibbonacci(f):
if(f<=1):
return f
else:
return (fibbonacci(f-1) + fibbonacci(f-2))
f = int(input("enter the value of f\n"))
for i in range(f):
print(fibbonacci(i))

shubhamsharma
Автор

Thanks a lot harry bro. This course is literally amazing. I learned C language from you, and now I am learning python. Your courses are way better than udemy courses.

adityapradhan
Автор

def factorial(n):

if(n==0 or n==1):
return 1
else:
return n*factorial(n-1)

print(factorial(5))

#code to print fibonacci series

def fibonacci(n):
if(n==0):
return 0
elif(n==1):
return 1
else:
return fibonacci(n-1) + fibonacci(n-2)

print(fibonacci(6))

khyati_sharma
Автор

a=int(input("Enter the number"))
def fabonaci(n):
if (n==0):
return 0
elif (n==1):
return 1
else:
return fabonaci(n-1)+fabonaci(n-2)
for i in range (a):
print(fabonaci(i))

JyotirmayeeRath
Автор

def f(n):
if(n==0):
return 0
elif(n==1):
return 1
else:
return f(n-1)+f(n-2)

a = int(input("Enter number of terms of fibonacci"))
i=0
while i<a:
print(f(i), end=" ")
i+=1

yashaswi
Автор

_n = int(input("Please Input any number: "))_
def f(n):
if(n==0):
return 0
elif(n==1):
return 1
else:
return f(n-1)+f(n-2)
print(f(n))

UltraGamerBS
Автор

def fibonacci(n):
if n<=2:
return n
else:
return fibonacci(n-1) + fibonacci(n-2)

nterms = int(input("Enter a number: "))

for i in range(nterms):
print(fibonacci(i))

karthikmudgal
Автор

def Fibonacci(n):
if(n==0):
return 0
elif(n==1):
return 1
else :
return Fibonacci(n-1)+Fibonacci(n-2)

print(Fibonacci(6))

gouravkumarshaw
Автор

a = int(input("Enter a number :"))

def fibonacci(n):
if(n==1 or n==0):
return n
else:
return

for i in range(a):
print(fibonacci(i))

sudhanshuverma
Автор

I was not able to do Exer3 KBC game myself but this worked. So, I believe I am learning something for sure. I was relieved when this program worked.

def fib(num):
'''Takes num and returns fibonacci series'''
if num ==0:
return 0
elif num==1:
return 1
else:
return fib(num-1)+fib(num-2)
print(fib.__doc__)
for i in range(10):
print(fib(i), end=" ")

GoGetSP
Автор

am from 5 class and am following you from last 2 years you are such a great teacher in world sir thank you for your efforts

raahimstudio
Автор

#100daysofcode
8:32
def fibonacci(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fibonacci(n-1) + fibonacci(n-2) # Recursive approach

print(fibonacci(6))
print(fibonacci(5))
print(fibonacci(4))
print(fibonacci(3))
print(fibonacci(2))
print(fibonacci(1))
print(fibonacci(0))


THANK YOU HARRY SIR

ayushkhaire
Автор

def fib(n):
if (n==0):
return 0
elif (n==1):
return 1
else:
return fib(n-1) + fib(n-2)

y = int(input("Enter any value for 'n': "))
print(fib(y))

trivendramathur
Автор

n = int(input("Enter a number\n>>"))
def fibonacee(number):
if (number==1):
return 1
elif (number==0):
return 0
else: return fibonacee((number-1)) + fibonacee((number - 2))
Ans = fibonacee(n)
print(f"Answer is {Ans}")

sakshamraj
Автор

def Fibonacci(n):
if n==0:
return 0
elif n==1:
return 1
else:
return Fibonacci(n-1)+Fibonacci(n-2)

n=int(input("Enter the terms to calculate the Sum of Fibonacci Series >>> "))
print('The Sum of', n, 'terms of Fibonacci Series is', Fibonacci(n))

SadharanLadkaIsBack
Автор

def fibonacci(f):
if (f<2):
return f
else:
return (f-1)+(f-2)
x = int(input("Enter a number: "))
print(fibonacci(x))

uafoundations
Автор

n = int(input("enter the number : "))
def fib(n):
if(n == 0 ):
return 0
elif(n == 1):
return 1
else:
return fib(n-1) + fib(n-2)
print(fib(n))

srikanthreddy
Автор

i=0
j=1
add=1
num=int(input('num:='))
print(i)
print(j)
for fib in range(num):
print(add)
i=j
j=add
add=i+j

kingsg