#40 Python Tutorial for Beginners | Recursion

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ •

  • @rajeshraut2955
    @rajeshraut2955 5 років тому +140

    a=1
    while a

    • @sudhamajayanthi
      @sudhamajayanthi 4 роки тому +14

      Hey your comment crashed my youtube !! ⚠️Beware of while loops⚠️ (just kidding 😁)

    • @harendragoswami5893
      @harendragoswami5893 4 роки тому +7

      U forgot to increment the value of a 😂😂😂, surely this loop will not work

    • @soumilitapadar4831
      @soumilitapadar4831 4 роки тому +13

      @@harendragoswami5893 it'll work, but till infinite lol, it needs an increment or break

    • @kthegreat69420
      @kthegreat69420 4 роки тому +8

      @@soumilitapadar4831 He want's to say that Telusko videos are infinitely awesome i suppose

    • @lodostic1015
      @lodostic1015 4 роки тому +1

      Put a+=1 at the end

  • @Abhimanyukumar-vb8bz
    @Abhimanyukumar-vb8bz 4 роки тому +131

    The best thing is that we get to learn from your silly mistakes also...And it's a Complement

    • @jyotisinha3384
      @jyotisinha3384 4 роки тому +17

      Programmers are the best examples of people who do mistakes till the last breath of life, learn from that and correct those mistake.

  • @b.sasikumar2141
    @b.sasikumar2141 4 роки тому +3

    Since 1 month I have been watching ur classes sir tq a lot.......🤝🤝

  • @Alberta_Farmer
    @Alberta_Farmer 2 роки тому +14

    Seriously just the most helpful tutorials ever. In 40 videos you have passed the knowledge depth that I've seen taught in two introductory state university courses for computer science.

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏

  • @chikeeze7799
    @chikeeze7799 2 роки тому +8

    Sir Navin this video is awesome, I am just learning for the first time that you can increase the recursion limit of a function to be greater than 1000. Thankyou very much I really appreciate.

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @xMikochix3
    @xMikochix3 5 років тому +14

    Thank you for helping me out!! I cannot seem to understand recursion for the longest time

  • @kharlopena7512
    @kharlopena7512 3 роки тому +6

    Thank you! You're the only person I've seen explain this in easy to understand terms!

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @rohit2025x
    @rohit2025x 4 роки тому +6

    Your lectures are awesome ...simple and beautiful 😍 thank you so much

  • @khansaheb9983
    @khansaheb9983 4 роки тому +7

    Anyone in 2020?
    I started learning c++ five years ago, and I got bored. Now after watching 40 of your videos this is my first comment. I never knew programming could this fun. Learned and executed all your scripts til now, and I am grateful to you.

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @chitvilaskalal22
    @chitvilaskalal22 5 місяців тому

    Amazing teacher i will found on the UA-cam ❤

  • @lucifer8050
    @lucifer8050 6 років тому +34

    Wow!! I never know a person can teach programs like this!!!

    • @samcodes2912
      @samcodes2912 4 роки тому

      yes he really is great at it

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

    • @Haroon_Safi
      @Haroon_Safi 5 місяців тому

      Harry is the best

  • @shailusv18
    @shailusv18 4 роки тому +2

    Telugu vara???
    super undi mee explaination....thank you so much for ur videos

  • @sharangees6416
    @sharangees6416 Рік тому

    Thnks Telusko ,i just impressed my girl with ur video !!

  • @majjuripavanteja1337
    @majjuripavanteja1337 Рік тому

    how did i miss this channal till now this comment is late but navin bro you did a great job 💥

  • @hetvichudasama9530
    @hetvichudasama9530 3 роки тому +3

    Thank you so much for this amazing tutorials 🙏🏻🙏🏻🙏🏻

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @anonymous25ja
    @anonymous25ja 4 роки тому +2

    ... I really...loved the way...of teaching....✌️🔥🖤

  • @adityajha1889
    @adityajha1889 3 роки тому

    this is the first video i am actually watching of your channel and i loved it so i subscribed.

  • @ibnofilasteen5983
    @ibnofilasteen5983 4 роки тому

    I learned better about recursion from this video. Shukran

  • @VANSHDUTTPATHAK
    @VANSHDUTTPATHAK 3 роки тому

    my man explained recursion so easily thank you so much

  • @maheehossain5481
    @maheehossain5481 5 років тому +12

    Mate you're an absolute fucking legend, thanks for this

    • @zavier9788
      @zavier9788 3 роки тому +1

      Your comment fucking killed me.

  • @054_ritesh3
    @054_ritesh3 4 роки тому +1

    Just Awesome 👍👍👍

  • @sunilkumarsamji8871
    @sunilkumarsamji8871 6 років тому +4

    Amazing information Navin Reddy. Helps beginners a lot. BTW in the above example on recursions. When the recursion limit is set to 2000. It prints 1996 times. Why is that? What happened other four iterations. Why they are not printed?

    • @azwarfareedhasni3413
      @azwarfareedhasni3413 3 роки тому +2

      Because Your Computer Needs Repair with A Hammer from Hammer Industries in Iron Man Movie...
      LOL JK

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @vishnumenon6541
    @vishnumenon6541 3 роки тому

    your videos have been helpful in my college examinations, thanks

  • @satoshinakamoto171
    @satoshinakamoto171 5 років тому

    your video and audio quality has improved alot since last i was here. keep it up

  • @noortusharkhan5034
    @noortusharkhan5034 4 роки тому

    Best Explanation and Teaching Method. Simply Awesome!!

  • @abhaypatel2345
    @abhaypatel2345 5 років тому +1

    telusko apna super star

  • @purplecrayon7281
    @purplecrayon7281 3 роки тому

    Best explanation of how to use recursion.

  • @nitheshmamidi
    @nitheshmamidi 7 місяців тому

    im printed for 100000 times its works sir

  • @usharawat2468
    @usharawat2468 4 роки тому

    Awesome, outstanding, superb, mindblowing video

  • @rajdevanesan6684
    @rajdevanesan6684 Рік тому

    I love Telusco and Navin

  • @-HemanthReddy
    @-HemanthReddy 3 роки тому

    Grt video sir I really enjoyed so much

  • @jollycolours
    @jollycolours 3 роки тому +2

    I watched every advertisement on your tutorials as a way of saying thanks for teaching us! You're my favourite Python sensei! (=

    • @viaclove
      @viaclove 3 роки тому

      Great support for content creators 👍

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @omsubratodey4160
    @omsubratodey4160 3 роки тому

    very nice lectures u made python lucid

  • @Nikhil_Dhand
    @Nikhil_Dhand Рік тому

    Thank You. I understood everything perfectly !

  • @AmanAliJB
    @AmanAliJB 4 роки тому +1

    really making this quarantine period fun and useful!

  • @shivanjalirajmane8931
    @shivanjalirajmane8931 3 роки тому

    Ur vdeos r really amazing.. Focused on practical things that's what highly required.. Ur java vdeos r also best...

  • @dharmchandra3256
    @dharmchandra3256 4 роки тому

    Sir you are amazing... Loved it... 👍👍👍

  • @ayushtiwari4829
    @ayushtiwari4829 4 роки тому

    you are the best sir
    i have never seen a better learning platform than yours

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @poonamleekha9591
    @poonamleekha9591 5 років тому +5

    I have no words to thank u because your python series is awesome. i belong to chemistry background from India and i only only watch your videos and learn it. if you have vidoes on practicing python coding, pls share because being a lay man we are not able to do that specially for the first time. thanks once again

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

    • @imfrommars7362
      @imfrommars7362 Рік тому

      @@shiwamkarn5215 because you are incrementing the value, so you will need to declare global since you are perrfoming a mathematical calculation to the variable

  • @vighneshboga2027
    @vighneshboga2027 4 роки тому

    def fibo(n):
    num1 = 0
    num2 = 1
    if n < 0:
    print('Invalid input')
    elif n == 0:
    print(num1)
    elif n == 1:
    print(num2)
    else:
    for i in range(n):
    num2 = num1 + num2
    num1 = num2 - num1
    if num2 > n:
    print(num1)
    break
    fibo(100)

  • @PrasannaKumar-zx7gr
    @PrasannaKumar-zx7gr 5 років тому +1

    Great sir.... Your explanation is interesting and easy to understand

  • @abdullahansari239
    @abdullahansari239 3 роки тому

    Thanks, you are great solved my problem
    Thanks alot

  • @moazelsawaf2000
    @moazelsawaf2000 6 років тому +2

    great and clear ❤,Thanks a lot sir ❤

  • @sudhirdaniel7207
    @sudhirdaniel7207 3 роки тому

    def like(n):
    i = 1
    for i in range(1,n):
    return i
    val = int(input("Enter your desire number:"))
    like(val)
    print(val)

  • @gokulsn8909
    @gokulsn8909 5 років тому

    superb bro... I am really lucky to see your videos

  • @vakhariyajay2224
    @vakhariyajay2224 2 роки тому

    Thank you very much. You are a genius.

  • @chessbd
    @chessbd Рік тому

    Deep knowledge indeed! Thanks!

  • @ashishranjanpatel9119
    @ashishranjanpatel9119 6 років тому +8

    You are amazing sir.

  • @taraksaha9
    @taraksaha9 6 років тому +1

    you made it super easy....thanks sir

  • @anuradhakumari6123
    @anuradhakumari6123 5 років тому +2

    Great learning. Thanks

  • @elamvazhuthi5604
    @elamvazhuthi5604 Місяць тому

    Nice explanation sir

  • @arthir3656
    @arthir3656 5 років тому +1

    You are just awesome sir :) Thank you so much for teaching in a very simple way... >>> import sys
    >>> sys.setrecursionlimit(1200)
    >>> print(sys.getrecursionlimit())
    1200
    >>> i=0
    >>> def function():
    ... global i
    ... i=i+1
    ... print('arthi', i)
    ... function()
    ...
    >>> function()
    Output:
    Traceback (most recent call last):
    File "", line 5, in function
    File "", line 5, in function
    File "", line 5, in function
    [Previous line repeated 995 more times]
    File "", line 4, in function
    RecursionError: maximum recursion depth exceeded while calling a Python object
    arthi 1197

  • @umarhasnain7369
    @umarhasnain7369 3 роки тому

    In subtitles, your name shows 'Revenge Ready' . I don't know why😆.
    But your tutorials are damn sooo goood

  • @krishnarout9176
    @krishnarout9176 4 роки тому +1

    Thank you sir by heart, you are really amazing

  • @pallavijain3366
    @pallavijain3366 4 роки тому

    Hey,
    By adding that
    sys. setrecursionlimit(2000)
    sys.setrecursionlimit(5000)
    What the range u want it been giving u..... So, I think there is no limit in recursion!!
    Sir your videos helping me with easy understand .
    Thank you!!

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @chandraroy2481
    @chandraroy2481 4 роки тому

    You are amazing ❤️❤️

  • @cse_b_57_kajal_dharmsale25
    @cse_b_57_kajal_dharmsale25 3 роки тому

    Nice teaching sir

  • @stockfish3379
    @stockfish3379 4 роки тому

    Love from Portugal🇵🇹

  • @mlittleprogramming780
    @mlittleprogramming780 4 роки тому

    Great video 👍🏻

  • @varunevani8942
    @varunevani8942 5 років тому +1

    a=1
    while(a>1)
    print("you videos are great")

    • @GS7999
      @GS7999 4 роки тому +1

      This one won't work cuz "a" should be greater than 1 in order to execute your print statement

  • @shiwamkarn5215
    @shiwamkarn5215 Рік тому

    4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why u didn't mentioned about this situation in Ur global keyword lecture😶😶🙏

  • @Fearlesser
    @Fearlesser 4 місяці тому +2

    Does anyone feel like they understand recursion but don't at the same time ?

  • @cutiepieakanksha5671
    @cutiepieakanksha5671 6 років тому +1

    Hi Navin, i have tried with same code its not working for me
    import sys
    sys.setrecursionlimit(2000)
    print(sys.getrecursionlimit())
    i=0
    def greet():
    global i
    i+=1
    print("Hello",i)
    greet()
    i got the 2000, i was not able to execute print function body part, please help me
    i got the below output when i executed
    "2000
    Process finished with exit code 0"

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @meghakashyap2353
    @meghakashyap2353 3 роки тому

    Thank you so much sir ..🔥

  • @bessyvinod5912
    @bessyvinod5912 3 роки тому

    Infinitely awesome videos

    • @zabvee
      @zabvee 3 роки тому

      Thanks to him love from philippines

  • @b.sasikumar2141
    @b.sasikumar2141 4 роки тому

    Nice lecture sir.....

  • @HowToBeta
    @HowToBeta 6 років тому +1

    Thanks for the video!

  • @ajaykumarprasad9272
    @ajaykumarprasad9272 5 років тому

    Thanks Navin Reddy for teaching is python programming

  • @NinadNakhwa
    @NinadNakhwa 4 роки тому

    Hi, I am using Python version 3.8.3. it gave me results 2957 times without making any changes to default setting in Jupyter notebook

  • @SwapnadeepMukherjee
    @SwapnadeepMukherjee 3 роки тому +1

    Tried with the value as follows:
    *sys.setrecursionlimit(5000)*
    The last value printed was:
    *Hello 2416*

    • @pratik5368
      @pratik5368 3 роки тому

      got last value Hello 2462

  • @Saha121-h6y
    @Saha121-h6y 5 років тому

    Sir I will subscribe in a day or two

  • @tatagovind12
    @tatagovind12 3 роки тому +1

    Str="your videos are unbelievable "
    Print(str*infinite)

  • @ABHISHEKKUMAR-ns6om
    @ABHISHEKKUMAR-ns6om 2 роки тому

    Sir, you look like Dr. Nitin Kumar Singh NASA-JPL Caltech, who is scientist at JET PROPULSION LABORATY............ 😊

  • @fatimah-hussain
    @fatimah-hussain 4 роки тому +1

    Hello, quick question. Why does it print infinite amount of times when doing the recursion without a limit?

  • @galeforceonline3847
    @galeforceonline3847 4 роки тому

    Thanks for showing recursion limit. It stops the problem I've been having

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @aryansinha7207
    @aryansinha7207 5 років тому +3

    I couldn't understand recursion until i watched you

    • @manish__g
      @manish__g 4 роки тому

      😂😂😂 bhai ab tumhara kuch nahi ho sakta 😂

  • @amankumarshawhalwai3973
    @amankumarshawhalwai3973 4 роки тому +5

    When I set the recursion limit at 2 it says the minimum depth is 40

  • @rohanmaharjan5537
    @rohanmaharjan5537 4 роки тому +1

    import sys
    sys.setrecursionlimit(2000)
    def telusko():
    For i in range(2000)
    print("Navin is awsome")
    telusko()

  • @suhaneshivam82
    @suhaneshivam82 4 роки тому +1

    There is a confusion.You said in one previous video that global variable can be used in any fuction locally so why do need to use global a inside the function?

    • @maniratnaprasad6007
      @maniratnaprasad6007 4 роки тому

      I too have the same doubt

    • @walkeparija
      @walkeparija 3 роки тому

      Check video #36 from 3:42, with that principle i is changing the value when we do i+=1. That's my understanding , please correct if I am wrong.

  • @arjitaagrawal270
    @arjitaagrawal270 4 роки тому +1

    Sir!!
    When we set the recursion limit to 2000..counter stops at 1996,,y so?it should go till 2000 or 1999 atleast.?

  • @amanthakur6913
    @amanthakur6913 4 роки тому

    def telusko(n):
    if n>=1:
    n=n-1
    print("Telusko is awesome")
    telusko(n)
    telusko(10)

  • @harshitasinha846
    @harshitasinha846 4 роки тому

    Sir can you plz help me with jupyter notebook it's showing kernel error and dead kernel.. am unable to work on it. Can you please help??

  • @abhijeetdeshmukh5093
    @abhijeetdeshmukh5093 4 роки тому

    Sir make a video to avoid time limit error in python

  • @GauravVerma-jk6cf
    @GauravVerma-jk6cf 3 роки тому

    sir, why in machinie i can only able to print 53 caes out of 100 and 953 out of 1000 cases , the error which is shown is "maximum recursion depth exceeded while calling a Python object"

  • @bhavyashah3249
    @bhavyashah3249 3 роки тому

    I was curious why this version of the code doesn't print out the numeric values beside the hello, and only prints out 1.
    def greet():
    i=0
    i+=1
    print("hello",i)
    greet()
    greet()
    does it matter if the i=0 is outside the define, or can we call it in the define function?
    thank you

    • @Inshorts_pk
      @Inshorts_pk Рік тому

      Because every time when you call greet ( ), it is re-initializing i value to 0.

  • @aishwaryalaxmiveeramalla739
    @aishwaryalaxmiveeramalla739 4 роки тому

    The last value its printing above limit 4000 is 3806 - 3808

  • @hiddenthings4820
    @hiddenthings4820 3 роки тому

    Sir, you are great ❤❤❤ But there is one problem with all of your videos that you make a lot of cuts, and that irritates. So try to reduce it.

  • @batuganghustler6411
    @batuganghustler6411 2 роки тому

    im having problem with this for 2 hours thank you very much rofl

  • @gulshankhanna5621
    @gulshankhanna5621 4 роки тому

    Thankyou so much

  • @thegamechanger7157
    @thegamechanger7157 3 роки тому

    Thanks

  • @adityajha1889
    @adityajha1889 3 роки тому

    thanks so much

  • @tejaswinid1022
    @tejaswinid1022 3 роки тому

    5:13 u do amazing and u r amazing

  • @gyaniguy0013
    @gyaniguy0013 6 років тому

    SIR PLEASE REPLY ME...I AM A CLASS 10 STUDENT AND I HAVE LEARNED JS AND JAVA AND SOME PYRHON WITH YOU..I WANT TO ASK THAT LEARNING FURTHER WILL HELP ME IN FUTURE PLEASE REPLY ME.MY PARENTS SAY THAT LEAVE EVERYTHING AND STUDY SCIENCE WND MATHS ONLY FOR IIT ENTERANCE..thanc for your awesome content MY NAME IS ANURAG BHandari

  • @kapilsingh9535
    @kapilsingh9535 3 роки тому

    Why do we need global keyword as global variable can access by the function then why?

  • @Arunmurali12
    @Arunmurali12 4 роки тому

    I'm using Jupyter Notebook, I have a question in minimum limit, it doesn't accept values less then 56.
    What if I need recursion less than 50 ?

  • @sachinkale4544
    @sachinkale4544 Місяць тому

    enjoyful..

  • @madhavaprashath1453
    @madhavaprashath1453 5 років тому +3

    print( " i like your videos so much!!!!!!!! ")

  • @suvrochoudhury1820
    @suvrochoudhury1820 5 років тому +3

    I'm using anaconda for my local python environment and it seems the "actual limit" is limit set -5. Attaching the sample code below; have fun!
    import sys
    sys.setrecursionlimit(2000)
    i=0
    def greet():
    global i
    i+=1
    if i

    • @shiwamkarn5215
      @shiwamkarn5215 Рік тому

      4:17 why we have to use global to access I because it is already global since I is assigned value outside the function...I really don't expect error there..why sir didn't mentioned about this situation in Ur global keyword lecture😶😶🙏 help🥺🥺🥺

  • @pennywise6058
    @pennywise6058 3 роки тому

    Thanks!

  • @taraparadarshit1449
    @taraparadarshit1449 3 роки тому

    How much time i should do coding? Please any suggestion