Finally keyword in Python | Python Tutorial - Day #37

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 351

  • @CodeWithHarry
    @CodeWithHarry  ปีที่แล้ว +137

    KBC wala game jis jisne nahi banaya bana lo.Video record hone wali hai exercise ke solution ki

    • @utkarshmishra823
      @utkarshmishra823 ปีที่แล้ว +2

      Harry bhai ye batao
      Apki peheli python serious best hai yaa joh aap abhi banaa rahe ho woh best hai

    • @codewithdhairya1193
      @codewithdhairya1193 ปีที่แล้ว

      me dal donga abhi

    • @arpankarmakar16
      @arpankarmakar16 ปีที่แล้ว +1

      Sir banayo toh hain lekin readability nahi hain zyada but ha banaya woh bhi aapke 27th video k 1 ghante k andar andar 😅

    • @MansoorSarookh
      @MansoorSarookh ปีที่แล้ว

      Loveeee

    • @mdsohanurrahmanhridoy1343
      @mdsohanurrahmanhridoy1343 ปีที่แล้ว

      LOVE YOU VAI😍

  • @tripleseven7771
    @tripleseven7771 ปีที่แล้ว +16

    I am a two star Competitive Programmer and thanks to python and C taught by harry. I recommend this course to everyone. Just think about it you spend only around 10 minutes everyday for python you can learn it in 100 days.

    • @zaheer4511
      @zaheer4511 ปีที่แล้ว +5

      you gotta practice other than those 10 minutes alone too brother

  • @shauryasaxena2406
    @shauryasaxena2406 ปีที่แล้ว +130

    HARRY BHAI PLEASE HAR VIDEO KE END MEIN EK QUESTION DEKE JAYA KRO PLZ

    • @imtiyazhussain5155
      @imtiyazhussain5155 ปีที่แล้ว +4

      Wright bro @code with harry yes 1question

    • @knowledgejr.
      @knowledgejr. ปีที่แล้ว +2

      I agree

    • @Strivarn
      @Strivarn ปีที่แล้ว +2

      Yes

    • @bayerwps3305
      @bayerwps3305 ปีที่แล้ว +6

      Nah.. mere jaise aur beginners ke liye overwhelming hota hai
      Jab log itne badhiya answers dal dete hai
      Fir motivation chale jayega 70% logo ka
      Ye nhi chahte honge vo

    • @knowledgejr.
      @knowledgejr. ปีที่แล้ว

      @@bayerwps3305 hmm

  • @khemchand494
    @khemchand494 ปีที่แล้ว +20

    In this video lecture, we learnt about another clause of exception handling used for error handling, which is finally keyword. The block of code written inside finally clause is executed always irrespective of the retun of the values from try or except blocks in a function. This fianlly clause may be used for various purposes like closing some resourse files, closing the database connections or ending the program with some appreciative messages.

    • @karkarthikeya7726
      @karkarthikeya7726 3 หลายเดือนก่อน

      Bro how do we close resources using 'Finally' I didnt understand plz explain

  • @tanvirgsm
    @tanvirgsm 2 หลายเดือนก่อน +1

    excellent approach to explain "finally" statement, big thanks.

  • @mrharvey8009
    @mrharvey8009 ปีที่แล้ว +7

    Harry bhai maja aa gaya ho! kal Python programming ki exam he aur aaj mene chalu kiya 20th videos aur 61th tak kiya. Maja aa gaya.
    1. Desi Explanation (as well theoretical explanation )
    2. Structured
    3. Notes
    Bhai udemy me jo premium course milte he na isse ye far better he.
    Kal exam me jo pure marks ayge vo bhai apki baje se aur mainly jo python ka funda clear hua na bhai maja a gaya Bhai aap AI, ML jese bhi course chalu kar dijiye
    Thanks Man!

    • @NabeelQureshi56
      @NabeelQureshi56 3 หลายเดือนก่อน

      Kitne marks aaye ? 👀

  • @dipipatra7162
    @dipipatra7162 3 หลายเดือนก่อน +1

    00:01 Finally keyword in Python for cleanup and error handling
    01:13 Python finally keyword ensures that a section of code is always executed, whether there is an exception or not.
    02:27 The 'finally' keyword in Python always executes, even if there is an error
    03:17 Understanding the concept of the 'finally' keyword
    04:21 Returning zero in Python indicates an error has occurred.
    05:15 The 'finally' keyword ensures that certain code gets executed regardless of whether there is an error or not.
    06:06 The 'finally' keyword is used to handle tasks such as database connection closure or file cleanup.
    07:02 Review the Python course and leave your comments

  • @vaibhavsoni4680
    @vaibhavsoni4680 11 หลายเดือนก่อน +4

    try:
    a=int(input("enter number one"))
    b=int(input("enter number two"))
    c=(input("enter +,-,*,/ for purticular action"))
    match c:
    case '+':
    print("addition is",a+b)
    case '-':
    print("subtration is",a-b)
    case '*':
    print("multiplication is",a*b)
    case '/':
    print("division is",a/b)
    case _ :
    print('invalid input')

    except:
    print('error 400')
    finally:
    print("thanku for using my calculator")

    • @RoyalPandit021
      @RoyalPandit021 11 หลายเดือนก่อน

      Bro why did you gave these codes

    • @snehaguptasneha28
      @snehaguptasneha28 11 หลายเดือนก่อน

      Thanks Brooo
      For this idea

    • @moizzwaqas3071
      @moizzwaqas3071 3 หลายเดือนก่อน

      we can simply use eval() function to make a calculator

    • @moizzwaqas3071
      @moizzwaqas3071 3 หลายเดือนก่อน +1

      a = input('enter your problem: ')
      cal = eval(a)
      print(cal)

    • @ZaraQureshi-i1d
      @ZaraQureshi-i1d 2 หลายเดือนก่อน +1

      @@moizzwaqas3071 thank you

  • @prithvirajpatil2916
    @prithvirajpatil2916 ปีที่แล้ว +16

    try:
    Learn Python programming
    except Exception as e:
    print(e)
    finally:
    Complete 100 days of Code by Harry
    😉

    • @a_pandey2024
      @a_pandey2024 7 หลายเดือนก่อน +1

      Bhai parenthesis and brackets to laga le 😂

    • @Abhijeet_Litoria
      @Abhijeet_Litoria 5 หลายเดือนก่อน

      print("Jalwa hai bhai ka")

  • @MrVaibhavv
    @MrVaibhavv ปีที่แล้ว +2

    hello harry bhai , मैं ने तुम्हारे सारे python के विडियो देखे है | फिर भी डू दूबारा मस्त revision हो रहा है | you are the best Teacher 😍😍😍😍😍😍❤❤❤❤

  • @enterashutosh
    @enterashutosh ปีที่แล้ว +3

    finally is the way to escape the indentation of try and except while remaining inside the def

  • @mdsohanurrahmanhridoy1343
    @mdsohanurrahmanhridoy1343 ปีที่แล้ว +5

    #DAY#37 Completed love from Bangladesh💚

    • @_ghelsappo_8489
      @_ghelsappo_8489 17 วันที่ผ่านมา

      please show some mercy to minorities there. Don't be an ungrateful pig.

  • @bitarzo5874
    @bitarzo5874 ปีที่แล้ว +3

    Harry bhai I am ur big fan, and i request u to make a video on "where to start ur cyber security journey as a student"

  • @navalprakash3727
    @navalprakash3727 ปีที่แล้ว +1

    Creating coffee vending machine
    try:
    coffee = ["red","green","yello"]
    select =coffee[2]
    except IndexError:
    print("Invalid number")
    finally:
    print ("Thankyou sir!")

  • @divyatagupta597
    @divyatagupta597 2 หลายเดือนก่อน

    this is a fantastic course as it describe everything in such a short span of time which is unbelievable

  • @eashovon
    @eashovon ปีที่แล้ว

    Present Brother From Bangladesh....Again After four days..I am back on this course... #Day37 Done

  • @hamzazaman5677
    @hamzazaman5677 ปีที่แล้ว +2

    Hello Harry Bhai, Plz make a Video on "'Subprocess Module" and other stuff related to that e.g PIPE, STDIN, STDOUT etc. thank You!

  • @nikhilkumarpandey1829
    @nikhilkumarpandey1829 ปีที่แล้ว +1

    Harry thode question mil jaate toh aur maje aajate lekin ab samjhne m maja aaraha h

  • @RajNamdev_19
    @RajNamdev_19 ปีที่แล้ว +1

    LOVE YOU HARRY BHAI❤

  • @88code
    @88code ปีที่แล้ว +1

    nice explanation harry bro . thank you

  • @manasdwivedi2223
    @manasdwivedi2223 ปีที่แล้ว +2

    Please Bro Make A Java Full Course After This Series

  • @Universal_kali
    @Universal_kali ปีที่แล้ว +7

    Respective Sir !
    According to variable naming rule in C, we can't use variable's first character any special symbol other then ( _ ) underscore, if i take variable as ( $age ) that is valid in gcc, so please tell me about that problem, how this possible?
    Please sir !

    • @Universal_kali
      @Universal_kali ปีที่แล้ว +1

      Finally I got the answer, now in Programming there are two special symbol one is underscore ( _ ) and 2nd is dollar ( $ ) can be use in variable naming as a first character.

  • @sachinc.8576
    @sachinc.8576 ปีที่แล้ว +2

    Harry bhaiya aapki vajah se mujhe mere 1st mid term me c language me out of 30 , 28 marks mile hai vo 2 marks bhi kuch galti ho gyi thi semi-colon vagaira ki to vo kat gye sirf aapke 15 hour complete c tutorial ki vajah se mujhe 28 marks aaye.
    Thanku so much bhaiya

    • @sherwinsabu
      @sherwinsabu ปีที่แล้ว +1

      heyy can you tell me which course you are pursuing ??

    • @bbamna5705
      @bbamna5705 ปีที่แล้ว +1

      kya hai sachin me lapu sa sachin hai bolney ko kuch avey na

    • @Rajroyal384
      @Rajroyal384 ปีที่แล้ว

      😂😂🤣🤣@@bbamna5705

  • @anonymous____________________4
    @anonymous____________________4 ปีที่แล้ว

    Pranam bhrata 🙏 apka bahutt baht dhanyawad ❤️😌🙏😇

  • @bibeksamal5300
    @bibeksamal5300 ปีที่แล้ว

    #34 complicated
    Love code with Harry 3000❤️

  • @atishthul4070
    @atishthul4070 ปีที่แล้ว +7

    Thank you so much harry brother for giving us this python free course ❤️

  • @gamex9553
    @gamex9553 ปีที่แล้ว +1

    day 37 completed

  • @harshrai4040
    @harshrai4040 ปีที่แล้ว +1

    Finally python wali video aagaya 🙃

  • @viditapatil
    @viditapatil ปีที่แล้ว +1

    @CodeWithHarry have you made any videos on UI / UX design??

  • @BoBBy.1818
    @BoBBy.1818 10 หลายเดือนก่อน

    This course is very helpful for me and i will proud on harry sir❤

  • @NEERAJ-dw9bt
    @NEERAJ-dw9bt 9 หลายเดือนก่อน +1

    Present sir 🤚

  • @masterhaker3539
    @masterhaker3539 ปีที่แล้ว

    It Made Finally Clear to me

  • @muhammaddaniyal463
    @muhammaddaniyal463 ปีที่แล้ว

    All videos are awesome

  • @indianrealgamer
    @indianrealgamer ปีที่แล้ว +1

    Suggest python book which we can read with this course

  • @AnkitGupta-s2h
    @AnkitGupta-s2h 8 หลายเดือนก่อน

    Finally: it is always executed even the function is completed or break or say successfuly executed then also it will executed

  • @justtalif
    @justtalif 6 หลายเดือนก่อน

    question: agar me kuch variables declare kr du try ke andar aur unse kuch operation perform krke kya me unhe finally me delete kr du for a memory clean up purpose toh kya ye better rahega

  • @mariamhasan3733
    @mariamhasan3733 ปีที่แล้ว

    Day #37 done!

  • @rohanpatil999
    @rohanpatil999 ปีที่แล้ว

    Harry sir C# ki full tutorial series chahiye 🙏🏻❤️

  • @minerfinger6814
    @minerfinger6814 8 หลายเดือนก่อน

    Thank you so much, I was so confused as to why finally is used. This explained it.

    • @drakeeagle
      @drakeeagle 8 หลายเดือนก่อน

      Bhai what is your dream 😅

    • @minerfinger6814
      @minerfinger6814 8 หลายเดือนก่อน

      @@drakeeagle Who knows?

  • @kracksilentgaming2830
    @kracksilentgaming2830 ปีที่แล้ว

    Finally keyword is for function only o r any other use because if you write I am always executed outside the indentation of the function it will execute

  • @Zaeemtechnical
    @Zaeemtechnical ปีที่แล้ว

    Harry bhai, Please is series me Asyncio bhi include karna , pura concept clear karwado bro

  • @newbie6783
    @newbie6783 ปีที่แล้ว

    best teacher on youtube

  • @aligetiravali1387
    @aligetiravali1387 ปีที่แล้ว +4

    Big fan of uh harry ✊🏻❤️

  • @CoderzGaming093
    @CoderzGaming093 ปีที่แล้ว +1

    #day37 love you harry bhai

  • @asimkhot5643
    @asimkhot5643 ปีที่แล้ว +2

    Hi sir I'm currently pursuing my computer science engg and I'm in 2nd year and I'm stuck between choosing two fields i need your assistance whether to choose cyber security or become a full stack developer and if it is possible plz make a video on it

    • @vaibhavnayak3416
      @vaibhavnayak3416 ปีที่แล้ว

      my suggestion - choose cyber security if you are good at it. You can see that syllabus and if interested then continue.
      Full stack is easy to learn because there are plenty of resources available. But for cyber security, not many resources. on youtube.

  • @AbhinavDubey-sn2vi
    @AbhinavDubey-sn2vi ปีที่แล้ว

    Harry Bhai Salesforce ka bhi course le aao Admin and Developer

  • @vishalgorana9726
    @vishalgorana9726 ปีที่แล้ว

    Nice Playlists

  • @ayeshaayesha7719
    @ayeshaayesha7719 5 หลายเดือนก่อน

    Agr koi hr video k end per qsn solve krna chata h to wo chat gpt per ja kr whan se us topic related info bhi le skta or gpt se qsn bhi jo k wo kdh se solve kr sake ye bhot acha way h kudh ko challenge krne ka 😊baqi exercise to di hui hen wo bhi solve krte rahe.

  • @_harufashion_
    @_harufashion_ 4 หลายเดือนก่อน

    Thank you

  • @arjunparmar4254
    @arjunparmar4254 ปีที่แล้ว

    Bhai DSA with Python plz continue this series

  • @Bynatwarrupeshjha2001
    @Bynatwarrupeshjha2001 ปีที่แล้ว

    Review : Very nice harry bhai i m too happpy that u started this course love ❤ u

  • @globonomics_in
    @globonomics_in ปีที่แล้ว

    The video is so useful.

  • @technikalproblem6780
    @technikalproblem6780 ปีที่แล้ว

    Thank you sir for creating this video!

  • @niteshch9166
    @niteshch9166 ปีที่แล้ว

    Present Harry Sir!

  • @MunnaBhai07
    @MunnaBhai07 ปีที่แล้ว +2

    6:18 why is return zero executed after finally?

    • @begthere3839
      @begthere3839 3 หลายเดือนก่อน

      its very obvious that when ever return is encountered by interpreter it should end that Program there only but since try except finally is happening so interpreter needs to be super smart there and he always takes care that if i encounter return i have to make sure is there some finally keyword used by programmer so even though return is written before finally bcoz of the rule of programming (especially rule of try except finally) finally will print first always and all instructions/statment below the indent of finally but no other statement after finally gonna print (means outside of scope/indent of finally)
      ,than immediately return will executed !

  • @uduthasaicharan3285
    @uduthasaicharan3285 29 วันที่ผ่านมา

    Full maza aa gaya

  • @yatindrapabbati6878
    @yatindrapabbati6878 ปีที่แล้ว

    DAY37-PRESENT SIR!

  • @aditya_mensinkai
    @aditya_mensinkai 6 หลายเดือนก่อน

    crazy explanation

  • @noobgamerankit9033
    @noobgamerankit9033 ปีที่แล้ว

    I understand it, sir!

  • @prashantrawat3096
    @prashantrawat3096 ปีที่แล้ว +3

    Sir I am a student of 8th class . I have a good knowledge of python .also good at math . Can you tell me what should I do prepare for IIT or learn more and more programming.
    Because if I start preparing for IIT than my coding skill will get less . And getting a job without degree is too much hard .
    Because If I star

    • @PrepHrid-ui4zt
      @PrepHrid-ui4zt ปีที่แล้ว +2

      start working towards iit in 10th or after 10th... iit syllabus is of 11th and 12th you cant study that right now anyways..try falling in love with maths physics, give NTSE olympiads.. it will help you in 11th 12th ..mind also needs exercise make it strong..
      and focus of college first, studying for it will improve your aptitude, one month of coding in good college will be equal to what you will do in whole 8th class.
      and iit nit provides you environment, imagine been friends with sharpest mind, playing and working with them day and night...you will be on right ship with right people... iit nit have unfair advantage, its easier to get internship, job in comparison to other college due to tag and value they hold and job market right now is not good for tier 3 college... big companies dont even come in small college where will showcase your skills then.. even if not job..iits is good platform to do research studies, u'll easily contact foreign profs

  • @chuhan7135
    @chuhan7135 ปีที่แล้ว

    Sir bootstrap par bhi bna den course

  • @tonykrafton2205
    @tonykrafton2205 ปีที่แล้ว

    Present !! Day 37

  • @SweetTooth2794
    @SweetTooth2794 7 หลายเดือนก่อน

    Review: Amazing content, I am thankful to you Harry bro❤

  • @jatinbhatt2222
    @jatinbhatt2222 ปีที่แล้ว +1

    Present Sir on Day-37 ✋

  • @qzarmy7059
    @qzarmy7059 11 หลายเดือนก่อน

    I Am Present Harry Bhaiya❤❤❤❤❤❤❤

  • @alphabeta6745
    @alphabeta6745 ปีที่แล้ว

    Thanks Harry bhai

  • @nitaidevnath615
    @nitaidevnath615 ปีที่แล้ว +1

    Hi Harry sir (💚ap ke Payton course ki videos is comments ke liya 💚) mera aap se ek question tha .....me to ek Arts ka Student huu ,... mene abi just degree complete ki hai arts me lakin utna interest nahi hai ...... Me web developer bannah chahata hu .... to mujhe kya konsi language sikhni chahiye ki me Google, Amazon jaise bare bare company me job pa saku ... Me time deneke liya ready 1 to 2 years.... Bas aap mujhe Roadmap bata do... me sikhne ke liya ready huu .... HTML & CSS sikha hai mene aap ki videos se Thank you 🙏💚💚💚

  • @SnehaSharma-kw6dw
    @SnehaSharma-kw6dw ปีที่แล้ว +5

    I faced the same issue several days ago while working on the fibonacci exercise... and im so glad you're literally answering our doubts without us even querying about them... thankyou so much and can you please explain fibonacci sequence exercise... im a bit confused... ❤

  • @goldroger3371
    @goldroger3371 10 หลายเดือนก่อน +1

    agr me without indentation ke print krdu to? mtlb ye to hai ki function se bahar hojayega but wo bhi to always print hoga na fir finally ki kya zaroorat?🤔

    • @avi.zworld
      @avi.zworld 2 หลายเดือนก่อน

      same query

  • @meditationmusic6482
    @meditationmusic6482 ปีที่แล้ว

    Thanks sir.

  • @satyampandey-fx8gz
    @satyampandey-fx8gz ปีที่แล้ว

    #day37 consistency maintain
    23:00 03/01/2023

  • @ParasKumar-fk4su
    @ParasKumar-fk4su ปีที่แล้ว

    Thankyou

  • @rahulzthema
    @rahulzthema 7 หลายเดือนก่อน

    Concept clear

  • @PratyushSharma-bz4pj
    @PratyushSharma-bz4pj 5 หลายเดือนก่อน

    in 3:50 how did you space together in code

  • @danyalasif8322
    @danyalasif8322 4 หลายเดือนก่อน

    Hello Sir g.Present Sir from Pakistan!

  • @Radhe_radhe2929
    @Radhe_radhe2929 ปีที่แล้ว

    Day 37 🔥

  • @hacknation2460
    @hacknation2460 ปีที่แล้ว

    37th lecture done

  • @Manish-qt1bz
    @Manish-qt1bz ปีที่แล้ว

    Present Sir 🔥

  • @TalhaTariq-i2e
    @TalhaTariq-i2e 8 หลายเดือนก่อน

    Nice🎉

  • @Rajivkhyaju
    @Rajivkhyaju ปีที่แล้ว +1

    Really Amazing 👏

  • @shivamchaudhary8592
    @shivamchaudhary8592 ปีที่แล้ว

    #Day37 Present Sir

  • @musicprofile6376
    @musicprofile6376 ปีที่แล้ว

    REVIEW: very nice I have no problem

  • @anshbajaj7223
    @anshbajaj7223 ปีที่แล้ว

    #day37 ✅

  • @akashvangane2196
    @akashvangane2196 ปีที่แล้ว

    Bro AWS ka tutorial banavo pls

  • @harshshukla5851
    @harshshukla5851 ปีที่แล้ว +1

    Harry bhaiya can you give python certificate on the basic of online test please bhaiya

  • @DhruvSharma-x6l
    @DhruvSharma-x6l 8 หลายเดือนก่อน

    Day 37: In this course:
    1] After understanding try except block, we understand new type of block used widely in Python and that is Finally.
    2] Any code inside finally gets executed, irrespective of code present in try or except gets executed.
    3] This is understood clearly by considering the below code:
    def func1():
    try:
    l = [1,2,3,4]
    a = int(input("Enter the index value:"))
    print(l[a])
    return 1
    except:
    print("Some error occured")
    return 0
    # Concept: any code in finally clause gets excecuted always, irrescpective of other chunk of code being either
    # in try or except block
    finally:
    print("I am always executed")
    x = func1()
    print(x)
    In this, if the line [print("I am always executed")] was not included in finally, then the function would only execute the valid block, in this case if index entered valid, then try block being executed, and the same for except.
    But once the line [print("I am always executed")] is enclosed inside finally clause, then if either try or block gets executed; if try executes, then finally will execute. Same for except as well.
    Thanks Harry bhai. Would love to meet you in person😊❤

  • @tenusharma7294
    @tenusharma7294 ปีที่แล้ว

    Bhai numpy or pandas par bi zero s video bnaa dooo apne jo videos bnayie hai vo 3 years s jyada purani ho gayi hai

  • @AtulKumar-sr7fv
    @AtulKumar-sr7fv 3 หลายเดือนก่อน +1

    i have a question!!!!
    if return statement was used in try/except clause which is before finally clause then why does "I am always executed" is being printed before 0/1????

    • @shristirawat6332
      @shristirawat6332 3 หลายเดือนก่อน

      because return value will always be executed at last after all the code

    • @AtulKumar-sr7fv
      @AtulKumar-sr7fv 3 หลายเดือนก่อน

      @@shristirawat6332 ok ,thnks..... had already figured it out :)

  • @vjournalbytej9832
    @vjournalbytej9832 10 หลายเดือนก่อน

    Present Sir 🤚

  • @Keepitshort417
    @Keepitshort417 ปีที่แล้ว

    present sir from Pakistan tharparkar more

  • @AnilKumar-xl1ju
    @AnilKumar-xl1ju ปีที่แล้ว

    print("I am Present")

  • @saugatnepal5956
    @saugatnepal5956 ปีที่แล้ว

    Done Day 37

  • @Vignesh-y4j
    @Vignesh-y4j 4 หลายเดือนก่อน

    37th one!!

  • @deekshithaparasu
    @deekshithaparasu ปีที่แล้ว

    #day37 completed

  • @RohanDasRD
    @RohanDasRD ปีที่แล้ว

    Day 37 done

  • @vipulyadav2144
    @vipulyadav2144 7 หลายเดือนก่อน

    harry bhai 💯💯💯💯💯💯💯💯

  • @harsh-alashi
    @harsh-alashi ปีที่แล้ว

    Harry Bhai OP

  • @krishna290gamer2
    @krishna290gamer2 ปีที่แล้ว +1

    Present||#100daysofcodechallange||day 37/100

  • @AnshumanPM
    @AnshumanPM ปีที่แล้ว

    Finaly ke andar return lagaye to chalega kya

  • @syed_abu_sufiyan_ali7041
    @syed_abu_sufiyan_ali7041 ปีที่แล้ว

    MySQL pr ek video hoajaye🤗