Python Tutorial for Beginners 6: Conditionals and Booleans - If, Else, and Elif Statements

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ค. 2017
  • In this Python Beginner Tutorial, we will begin learning about if, elif, and else conditionals in Python. We will also be learning about Booleans and what evaluates to True and False. Let's get started.
    The code from this video can be found at:
    github.com/CoreyMSchafer/code...
    Watch the full Python Beginner Series here:
    • Python Programming Beg...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com/shop/coreyschafer
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Python

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

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

    udemy courses = 0 level understanding
    corey's python videos = 9999 level understanding

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

      Corey is awesome. However, Is Udemy really that bad ?

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

      @@alonbechor1842 I use Udemy as an additional platform of advice and technique for my code. Trust me , Udemy is not bad at all. Its worked for me in regards to understanding certain things on Python 3.

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

      Agree, I tried 3 weeks with Udemy and I didn't catch as much as 3 days with Corey here, his videos are so smooth and practical! I'm learning with him and codecademy :)

    • @arunsd2108
      @arunsd2108 3 ปีที่แล้ว

      @@yellowmotif i've started recently to learn python .Must i see all those videos from this playlist in order to learn all the fundamentals?

    • @arunsd2108
      @arunsd2108 3 ปีที่แล้ว

      @@yellowmotif if not could you please tell me which of the videos should i see?

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

    Corey, I would donate to you, but all of my money went to the university that taught me absolutely nothing.

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

    English is my second language. But I could even totally understood what Corey explained.

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

      He has the best Python Channel on TH-cam, hands down!

    • @us-xf3kk
      @us-xf3kk 3 ปีที่แล้ว +4

      Pay him

    • @aka-Monster01
      @aka-Monster01 หลายเดือนก่อน

      @@us-xf3kk u too pay him

  • @AMINE-yy3zb
    @AMINE-yy3zb 6 ปีที่แล้ว +81

    Man. This feels like medicine. It makes one confident to do coding.

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

    For those that take notes:
    # Comparisons:
    # Equal: ==
    # Not Equal: !=
    # Greater Than: >
    # Less Than: <
    # Greater or Equal: >=
    # Less or Equal:

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

    .Those lessons are pure gold

    • @Mobin92
      @Mobin92 6 ปีที่แล้ว

      The code is basically unreadable...

    • @meltedcheese1908
      @meltedcheese1908 6 ปีที่แล้ว

      +Mobin92 In what way? I can understand it all.

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

      .Those_lessons_are_pure_gold()

    • @NervylHraje
      @NervylHraje 5 ปีที่แล้ว

      @@CodingUnited just 8 months later ;)

    • @benzeltser9851
      @benzeltser9851 3 ปีที่แล้ว

      @God player
      I said it almost 4 years ago
      Still super relevant.

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

    Your tutorials are great! What i like about them the most is that they are fast, don't waste my time and everything in them is important! Thanks

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

    Dude, I have to say, after trying to study python for about a week I found it really interesting but then I got off it for about a week or so due to work and I was completely put off and found it really hard to get back into it and then I came across your videos. Your videos are truly amazing, the way you explain is remarkable and I don’t know why someone would go pay to learn when there are videos and channels like yours. each topic is thoroughly explained and the way you explain it makes it a lot easier to understand. Carry on with your hard work and thank you so much for these videos !!

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

      I turely agree with you bro. I tried many different channels, books, and even few udemy paid courses (pirated), but I can't find someone explaining like him.

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

    I am keep coming back to these amazing tutorials all those years after. Hands down one of the best channels for getting solid and well explained educational content. Much respect Corey from a proud patreon supporter

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

    True and False values which you have mentioned are veryyy veryyyyy useful! Your tutorials covers lot of important things which other tutorials don't even bother about. You are awesome. Thanks Corey for providing such great videos!!!

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

    Corey, thank you so much for those videos. The best teacher I have encountered.

  • @samarthsingh8741
    @samarthsingh8741 3 ปีที่แล้ว

    The thing I love is that you explain all of it in such short time! Thank you so much!

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

    Learning Python for the first time and finding these tutorials extremely easy and helpful. Thanks!

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

    I am amazed by your ability to explain things in simple and quick manner. Thanks a lot for tutorials! God bless you!

  • @12Prophet
    @12Prophet 7 ปีที่แล้ว +261

    I'm loving your tutorials, they are very clean and organized. The audio is good and you're going at a good pace. Please, please keep at this level of professionalism.

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

      Are you in a parallel universe? This video was literally anything BUT professional. Crappy resolution, girlfriend talking in the background, black bars around the video, and what he is showing is completely useless code. Did he pay you to write this?

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

      I live alone. So if someone is talking in the background then my house must be haunted. And black bars around the video? I think you watched something else...

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

      LOL :-))))

    • @user-xg3yf4yk6q
      @user-xg3yf4yk6q 6 ปีที่แล้ว +25

      FFS people complaining for FREE content that obviously required hell alot of work upfront... Thanks a lot Corey to share your precious knowledge with us.

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

      +Mobin92 What black bars around the video? You must be on a high res monitor. The code that he is showing gets across the point of if statements and how they are helpful.

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

    Thank you very much, simplified and fast. definitly one of the best toutorials :)

  • @WathiqHAtrah
    @WathiqHAtrah 4 ปีที่แล้ว

    You are Print "The God of Python", your tutorials are very concise, clean, clear and very easy to understand...

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

    i missed half a year worth of learning for my computer science gcse because of the pandemic and these videos are really bringing me up to speed thanks!

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

    I just found your channel dude your lessons are so clear and to the point. Thanks bro. Definitely going to go thru the course to learn.

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

    Corey, you are the best teacher I have seen.
    Thanks for such a wonderful videos.

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

      Thanks!

  • @user-yt4px4zr3s
    @user-yt4px4zr3s 5 ปีที่แล้ว +21

    You are absolutely the best Python teacher!!!

    • @NuEnque
      @NuEnque 5 ปีที่แล้ว

      you're hot!

  • @Drone360pilot
    @Drone360pilot 2 ปีที่แล้ว

    Best tutorials for Python that I have ever seen. Deeply appreciated 🙏🏼

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

    Thank you Corey for your time and effort. Keep spreading the knowledge.

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

    Corey, these tutorials are really great. I wish I had come across your videos a lot sooner. You are precise, clear and speak at the right pace, and you've made it a lot easier to understand the language. A big thank you.

  • @guess2014
    @guess2014 3 ปีที่แล้ว

    All comments are 100 % positive..! Congrats Corey Schafer. This shows your effort.

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

    Can't stop watching! I love these videos! Thank you so much

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

    Def one of the best tutorials out there. Love the content a lot mate. Much respect to you Corey :)

  • @saiyam2509
    @saiyam2509 2 ปีที่แล้ว

    You made learning Python so interesting and easy. What a Saviour!!! Thank you!

  • @kalyanit8551
    @kalyanit8551 4 ปีที่แล้ว

    Easy to grasp the subject with full clarity. Thanks for make it free.

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

    Thanks sir, this video gave a better understanding of if else statements. Currently taking Automate the Boring Stuff at Udemy right now, and your tutorial is a great help.

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

    Wow, i've been trying to wrap my brain around this for 2 days now. Finally got it. You're a good teacher. Cheers mate.

    • @engr.mubasharhanif
      @engr.mubasharhanif หลายเดือนก่อน

      hey, are you programmer or python expert now?

  • @mohammadsalahradi2293
    @mohammadsalahradi2293 2 ปีที่แล้ว

    I like your videos. You explain complex things in an easy way. Your videos are essentially beneficial kickstart for beginners. Keep going.

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

    Thank you so much, I was stuck and then I found this video, couldn't thank you more.

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

    Concise, constructive and smooth.

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

    best tutorials in whole universe.

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

    Thanks a million for these tutorials Corey!

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

    Corey Thanks for amazing tutorials will recommend to my colleagues as well

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

    The best tutorials on the net...

  • @md.shorifulislam8366
    @md.shorifulislam8366 5 ปีที่แล้ว +1

    Amazing Bossssss ! Salute !! I am getting very inspired thinking that I can have much knowledge from you....many many thanks !!!

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

    Fast, accurate and to the point, Love it! :)

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

    Ur teaching style is really good

  • @philippe6724
    @philippe6724 6 ปีที่แล้ว

    Fantastic teacher and pedagogue !

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

    I am telling you. This man is gold!

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

    Cory you have saved my life with your videos, I can't say how much. I have been struggling. I started to think I was just pure dumb cos most materials I came across were not broken down this way. I just wish i had found your videos a month earlier, i would have gotten a better grade in school. Thanks man! you're awesome.

    • @engr.mubasharhanif
      @engr.mubasharhanif หลายเดือนก่อน

      hey, are you programmer or python expert now?

  • @yogabull5929
    @yogabull5929 6 ปีที่แล้ว

    Dude, thanks for this video. I'm wrapping my head around this !

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

    That explanation of what evaluates to false was extremely helpful

  • @frankpercicotte
    @frankpercicotte 3 ปีที่แล้ว

    Wonderful lesson, your teaching is easy to understand! Thanks!

  • @saintz_aj
    @saintz_aj 2 ปีที่แล้ว

    I just finished listening to a 3 hour lecture that I learned nothing despite asking questions to clarify and elaborate condition using examples. Thanks for this, well delivered and easy to understand.

  • @Steadyrock100
    @Steadyrock100 9 หลายเดือนก่อน

    You make Python easy! After this tutorial, im ready to take on more Python!!!! Thank You!!!!!

  • @alphabetsalphabets5242
    @alphabetsalphabets5242 3 ปีที่แล้ว

    I thought I know the basics of python well until this video series. It just showed me how untrue that is, and you know what? I'm glad it did, because now my basics are a lot stronger than they were before. Also you are a fantastic teacher.

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

    Very helpful Python serial tutorial. Love it. Thanks.

  • @sonetmollick4630
    @sonetmollick4630 3 ปีที่แล้ว

    Great lecture. I learned a lot from here in short period of time.

  • @vivekluthra21
    @vivekluthra21 3 ปีที่แล้ว

    Thank you so much! For explaining all the things in such a easy way.

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

    Thanks, I might be a complete nobody in python, but I got these vids to keep succeeding.

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

    2024 and your still helping learners!! big thanks! your explanation made a lot more sense then my course in Udacity!

  • @aatt3209
    @aatt3209 4 ปีที่แล้ว

    another excellent tutorial, CS is the best Python teach out there!

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

    great one. love the examples on false values considered on python. thanks man.

    • @Mobin92
      @Mobin92 6 ปีที่แล้ว

      What?

  • @muslimaallayorova2087
    @muslimaallayorova2087 4 ปีที่แล้ว

    I have watched a few of other tutor, Corey is best on these part , thank you. best=your knowledge and explanation if True: print(corey)

  • @zolamakhosonke7982
    @zolamakhosonke7982 2 ปีที่แล้ว

    The way you make what I considered hard so easy I feel like, what a genius you are, it like you understand how my brain can understand python 😂. Thank you so much about that, I appreciate your videos 🤝.

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

    This is undoubtedly the best course across the Internet!! Thanks a lot for creating this course. Sir, If possible, can you please make exercises on the topics covered in videos? It would be a great help for practicing. If not, please at least refer us the best place for practicing.

    • @engr.mubasharhanif
      @engr.mubasharhanif หลายเดือนก่อน

      hey, are you programmer or python expert now?

  • @abdullahyaqoob3741
    @abdullahyaqoob3741 4 ปีที่แล้ว

    or, and are unlimited you can add what ever number of condition when use these two conditions.
    Good job man

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

    Thank you so much for the excellent job!

  • @dhk.yankees
    @dhk.yankees 3 ปีที่แล้ว

    I'm from Bangladesh man.And Your Explaining level is Brilliant.Love you man.

  • @flybird8693
    @flybird8693 2 ปีที่แล้ว

    Best tutorials ,many thanks

  • @martyedge
    @martyedge 3 ปีที่แล้ว

    You, Sir, are a lifesaver.

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

    You explain much better than my university teacher!

  • @afx-azizyarfx994
    @afx-azizyarfx994 3 ปีที่แล้ว

    This helped me alot, thanks!

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

    Great video! Always a clear explanation : )

  • @arjungoud3450
    @arjungoud3450 3 ปีที่แล้ว

    Thank a lot, with 2 min watch I understood properly.

  • @TarynMychalMai
    @TarynMychalMai 4 ปีที่แล้ว

    I feel wayyy better about conditionals, thank you!

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

    I truly appreciate you example picking skills :)!!!....

  • @rajgiriyt8494
    @rajgiriyt8494 2 ปีที่แล้ว

    person with 0% haters.. love you from nepal

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

    Thank-you this was a very helpful video, I stumbled on a reddit site where I saw two people recommended your name. One person said they like to return back and re watch your videos even though they have been programming for awhile.

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

      I was also finalizing the right channel to start with. Finally started with this gem yesterday

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

    By the way, your videos are really awesome i.e even I understand what they are. Thanks for your commitment.

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

    Thank you Corey

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

    The simplest way of teaching 😍👍

  • @exploretheworld9111
    @exploretheworld9111 3 ปีที่แล้ว

    now i am sure I am going to be a program developer. thank you Corey Schafer. Gonna join your digital academy.

  • @farshad-hasanpour
    @farshad-hasanpour 4 ปีที่แล้ว +1

    best python tutorial ever

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

    I love your tutorial keep up the good work 👍
    I liked and subscribed👍

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

    another great video. thanks again

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

    Thanks. Really helped me.

  • @7XxKiKoOxX7
    @7XxKiKoOxX7 3 ปีที่แล้ว

    Tutorial 06/143 done ! Tyvm

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

    I am loving your tutorials. I am just getting into programming. I am putting my own exercises together from each of your videos. By any chance, have you created exercises that I would be able to follow so that I can put what I have learned so far into action?

  • @Sakthivel-zp9xg
    @Sakthivel-zp9xg 5 ปีที่แล้ว +1

    Excellent Corey!!!! Nice video!!!!!!

  • @RameezRaja-qc9fi
    @RameezRaja-qc9fi ปีที่แล้ว

    Excellent work brother

  • @ab5848
    @ab5848 3 ปีที่แล้ว

    Thank you sir 👍

  • @balain501
    @balain501 6 ปีที่แล้ว

    Wonderful tutorial!

  • @salman335588
    @salman335588 3 ปีที่แล้ว

    Thanks Corey

  • @Voyager602
    @Voyager602 2 ปีที่แล้ว

    That was really helpful

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

    very helpful. thankyou ! so much.

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

    This was another good video, thanks

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

    Great tutorial =)) Thanks man, really appreciate your work.
    By the way, I just check and actually if you set condition = 10 or 100 or -5,... THE CONDITION IS NEITHER TRUE OR FALSE. The reason why it print "Evaluated is False" in your code is because you use the "else" statement. It just means that the condition is NOT TRUE. It turns out that 1 is True and 0 is False and that's it. Please try this code:
    condition = 10
    if condition == True:
    print('Condition is true')
    elif condition == False:
    print('Condition is false')
    elif condition == None:
    print('Condition is none')
    It prints nothing, same for empty List,...
    Still, your tutorial is awesome :)) Keep up the good work!

  • @abhishekstatus_7
    @abhishekstatus_7 3 ปีที่แล้ว

    Best #Python tutorial i have ever found !

  • @thirdwavve2748
    @thirdwavve2748 2 ปีที่แล้ว

    Thanks for the work you put into these tutorials. What do you recommend is the best way to follow-along with these tutorials for maximum results?

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

    Hey Corey, great lessons. Actually I found a way to implement switch statements into python with dictionary. For example:
    language_switcher = {
    "Python" : "Language is Python ",
    "Java": "Language is Java",
    "JavaScript": "Language is JavaScript"}
    print(language_switcher.get(language))

  • @meltedcheese1908
    @meltedcheese1908 6 ปีที่แล้ว

    Great video man!

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

    loving them

  • @juniorizcortes6370
    @juniorizcortes6370 3 ปีที่แล้ว

    Sir, you deserve to have millions of subscribers and you have mine. This is gold compared to udemy courses.

  • @frederic_viennot
    @frederic_viennot 2 ปีที่แล้ว

    AMAZINGLY CLEAR !!!! thank you ;))

  • @isratjahan7653
    @isratjahan7653 6 ปีที่แล้ว

    I'm fascinated by your automated tone