if if if if if....elif

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024

Комментарии • 816

  • @NetworkChuck
    @NetworkChuck  2 года назад +68

    What I use to learn (the BEST IT training): ntck.co/itprotv (30% off FOREVER) *affiliate link
    In this episode of Learn Python RIGHT NOW, NetworkChuck teaches how to let good Ben in using Nested Ifs and Elif statements!
    FREE Python Lab: ntck.co/pythonep5
    Support the course: ntck.co/pythonrightnow
    🔥🔥Join the NetworkChuck membership: ntck.co/Premium
    **Sponsored by ITProTV
    0:00 ⏩ Intro
    2:50 ⏩ Figure out if Ben is EVIL
    3:23 ⏩ STEP ONE: Ask Ben if he is evil
    4:22 ⏩ NEW CONCEPT: Nested IFs!!
    5:48 ⏩ Nest the code under the Second If statement
    6:38 ⏩ No nice Greeting for Nice Ben?!
    7:18 ⏩ Make Ben feel special!!
    9:50 ⏩ Robot Barista is doing a great job but changes are needed
    11:03 ⏩ Messy fix for the menu
    12:46 ⏩ NEW CONCEPT: Else If (ELIF)
    14:58 ⏩ Let’s add an else
    16:25 ⏩ CHALLENGE: Whipped Cream??
    17:04 ⏩ Outro

  • @ablesentry7070
    @ablesentry7070 2 года назад +206

    Thanks, Chuck for continuing this series. I've recently gotten into Linux/Virtualisation/Python because of your channel. I love ALL of it, learning something new each day.

    • @frosty7845
      @frosty7845 2 года назад +1

      Same

    • @rmp5640
      @rmp5640 2 года назад

      Where di you guys learning?

    • @animepfpkid5216
      @animepfpkid5216 2 года назад

      @@ISCARI0T 🤡

    • @nissohy
      @nissohy 2 года назад

      Me too. I threw my tv out of the window since I inside chuck RUclips Chanel AND NO if or else for me since then (-:

    • @shortthings8160
      @shortthings8160 2 года назад

      @@ISCARI0T LMFAO

  • @Aqua021
    @Aqua021 2 года назад +90

    Hey Chuck please never stop the series i started learning it because of you man

  • @HasGoesWild
    @HasGoesWild 2 года назад +43

    To the people this was recommended to 10 years in the future NetworkChuck was the most consistent youtuber back in 2022

    • @Zoro69016
      @Zoro69016 8 месяцев назад +3

      It is now two days before 2024

    • @Zoro69016
      @Zoro69016 8 месяцев назад +3

      His teaching method is great

    • @simonhermon3958
      @simonhermon3958 Месяц назад +1

      nah bro definitely hacks Da Hood

    • @Arabian_knight_101
      @Arabian_knight_101 26 дней назад

      2024 I'm still here

  • @tomscott8820
    @tomscott8820 2 года назад +29

    I used to be a fan but after this masterpiece i'm a whole air conditioner

  • @mr_hashbrown
    @mr_hashbrown 2 года назад +68

    Thank you for the new episode! So far, you're the only fun, interesting and entertaining person I've seen to teach people Python and even Linux, making it look so easy!

    • @NetworkChuck
      @NetworkChuck  2 года назад +19

      Thank you 😊

    • @allfun2468
      @allfun2468 2 года назад +3

      Your are not wrong about that

    • @mr_hashbrown
      @mr_hashbrown 2 года назад +5

      @@NetworkChuck, you're welcome!

    • @alexpenna
      @alexpenna 8 месяцев назад

      That's the best user name I have seen this month

    • @mr_hashbrown
      @mr_hashbrown 8 месяцев назад

      @@alexpenna 😂😂

  • @aliyahmillan3882
    @aliyahmillan3882 2 года назад +25

    I wish my professors were like you. I swear I learn more from watching your videos than sitting for hours in a class.
    Thanks for the great content.

    • @vinnieg6161
      @vinnieg6161 Год назад +1

      good teachers are everything

  • @Saffron777
    @Saffron777 2 года назад +75

    I'm taking python programming in college right now and your series is ALMOST on track with our class... I wish I had this video before my test yesterday because I got points off on the elif questions 😵‍💫 if this was posted on Tuesday I might have had a higher grade on my midterm!!!!

    • @evgeniyalafev9781
      @evgeniyalafev9781 Год назад +8

      why are you making him feel guilty? lol j/k

    • @conm9891
      @conm9891 Год назад +2

      Huh? You first mention a test, then midterm. If you didnt know you have a midterm then you have some bigger issues then your grammar.

    • @gaatjenietsaan88
      @gaatjenietsaan88 Год назад +1

      I watched all these video's today i am hooked

    • @Krullfath
      @Krullfath Год назад +2

      @@conm9891 It seems you misunderstood and misinterpreted the timeline of events in the original comment. Your reply criticizes the grammar of the original commenter, but the comment itself acknowledges the presence of grammar mistakes, so this criticism is redundant.

  • @MansoorBarri
    @MansoorBarri 2 года назад +10

    Challenged solved:
    elif order == "Latte":
    whip = input("Do you want extra whip cream?")
    if whip == "yes":
    price = 11
    else:
    price = 9

    • @NetworkChuck
      @NetworkChuck  2 года назад +3

      Excellent job!

    • @vicki-annthornton8330
      @vicki-annthornton8330 Год назад +1

      thanks so much I could not figure it out - of course we add another variable! I was trying to allocate it to order

    • @MansoorBarri
      @MansoorBarri Год назад

      @@vicki-annthornton8330 cheers

  • @priyanshdahiya3043
    @priyanshdahiya3043 2 года назад +26

    New episode on python made super simple.This is very "unique" man.
    Love how you make things so interesting.

  • @vindicatedafi
    @vindicatedafi 2 года назад +17

    Doing a python course for college super helpful. Something about the way you present the material is very simple and concise keep up the great work!

  • @josue6131
    @josue6131 2 года назад +6

    I’ve gone through this whole series in a night and I can’t be thankful enough for 1) the raspberri pi I bagged on your birthday lol and the amount of knowledge and how easy you explain it to someone who has 0 idea about anything like this! I finished the challenge and felt so good, I will forever thank you for this and your other videos Chuck! I hope you read this and acknowledge how crucial you are to an entire generation and the ones to come!

  • @depends3652
    @depends3652 2 года назад +4

    Amazing so far. I went from not knowing code yesterday to writing my own Barista in tandem with this. Even have a replit account now for it.
    Going to attempt to build a game with only what was learned from 1-5. Honestly almost had it but could not figure out "elif" on my own.
    Keep up the great work! You are honestly one of the greatest teachers I have had the pleasure to learn from.

  • @MindFuel7
    @MindFuel7 2 года назад +8

    Thanks God bro you're back with Python Episode kindly complete it

  • @dystopianpalace9778
    @dystopianpalace9778 2 года назад +27

    love your python course ♥

  • @brandonpike7046
    @brandonpike7046 2 года назад +2

    Oh my god your teaching style is really effective. Your 3 (4) classes are the only experience I e had with coding and I was able to solve the “allow evil Ben into the shop” problem all by myself. Thank you so much for this!!!

  • @Sensei__Nate
    @Sensei__Nate 11 месяцев назад +1

    Dude I love the pauses bc it makes me actually try and think it through, and I also did the challenge first try !! This course is sick!

  • @OkanaganLife
    @OkanaganLife Год назад +1

    Hey @NetworkChuck. I'm 42 years old and have been wanting to learn programming my whole life, but never got around to it. Thanks for making this so accessable. I've been really enjoying your videos and how you make it fun and simple. Keep doing what you do man, because it's so good. God bless brother.

    • @dmitrydji6172
      @dmitrydji6172 Год назад

      same thing here man, 41. My daughter got me into it, but Chuck is making it easy.

  • @surecode6763
    @surecode6763 2 года назад +3

    chunk = input(" continuing teaching? ")
    if chunk = "yes":
    print("thanks, keep teaching")
    exit()
    else:
    print("you must teach, you can't leave us😅")

    • @foxdk
      @foxdk 2 года назад +1

      Use "==" to compare instead of "=". What you're doing in your example, will always return the thanks, since you're reassigning the value to the variable chunk.

  • @reastle1307
    @reastle1307 2 года назад +3

    you are my best teacher! Honestly the way u teach is nothing like teacher i know in real life ❤💻💻

  • @nathanvargas713
    @nathanvargas713 4 месяца назад

    Hey Chuck, this python playlist is truly the best I've ever seen. I literally opened a new file and started coding from your videos when I was nervous to even start by doing it. Your a great teacher and I learned a lot from your videos, excited to watch more and learn more.

  • @MasoodOfficial
    @MasoodOfficial 2 года назад +12

    Amazing!!!! The best tutorials ever, can't wait for more.

  • @shortsman380
    @shortsman380 2 года назад +4

    Thank you Chuck.
    Because of you, I have started learning python and have just engaged in virtualization

  • @monicamoses420
    @monicamoses420 4 месяца назад

    It's like the tutorial is one on one and not on youtube! Chuck, you make it so easy to understand! Thanks!

  • @20002000l
    @20002000l 2 года назад +6

    Since you call the exit() function when Ben is evil, you can remove the else function and just print out the text once (instead of twice, like you have now)
    That makes the code much cleaner

  • @mihrangamerz2236
    @mihrangamerz2236 2 года назад +2

    Don't ever quit from RUclips you are awesome

  • @ZA_Atomic
    @ZA_Atomic 4 месяца назад

    Your the only person who shows enthusiasm in teaching great teacher

  • @Jake-dc3bv
    @Jake-dc3bv 2 года назад +2

    I'm not sure what you've got against green tea but as a complete python noob this is one of the most easiest to follow explanations of if, elif, else I've watched!

  • @OneWhoWas
    @OneWhoWas Год назад

    I have my 12 yo following along with your exercises.
    He's getting there. We sit down and watch your videos, then he goes and tries it out, I make myself a coffee, and I can help him when he's stuck. It's an evening routine and gets him away from the video game world for a bit to learn something useful. It's awesome.

  • @saurbh22
    @saurbh22 2 года назад +3

    The way you explain is really I love it, you go in core of any topic thats amazing...

  • @Zayn2.
    @Zayn2. 2 года назад +16

    love your python course 👍

  • @Motivation2Invest
    @Motivation2Invest 2 года назад +4

    Exceptional this is better than any university course, would love more soon! Happy to pay for large course with you teaching,

  • @SunDevilThor
    @SunDevilThor 2 года назад +2

    Chuck, all of your outro music is dope! I would love a link to a Spotify playlist if you have one available. I’ve also listened to your RUclips live music video a few times.

  • @Fuzzyfull
    @Fuzzyfull 2 года назад +7

    Great video! I think you skipped over one important thing regarding the "elif": The main difference between sequential if's and if..elif...elif block is the fact that 'if' statements will always be evaluated, but if...elif block will be exited at the first successful evaluation and further elif's will be omitted.

    • @kindlehaha
      @kindlehaha 2 года назад +1

    • @Islanddreamer430
      @Islanddreamer430 2 года назад +1

      It took me hours to figure this out 🤦🏽‍♀️

    • @Islanddreamer430
      @Islanddreamer430 2 года назад

      Love your channel Network Chuck. It was “duh” on my part because I also have a text book. Your videos are helpful. And thanks for the tip @kristaps bergfelds.

  • @akshatkumar369
    @akshatkumar369 2 года назад +1

    I just love coming to this channel and learning some thing new each day! Thanks, Chuck!

  • @xeliloruclu6607
    @xeliloruclu6607 2 года назад +1

    You are explaining better than my teacher . Its perfect man

  • @beast6092
    @beast6092 2 года назад +1

    You've got to love his enthusiasm!

  • @geef0813
    @geef0813 11 месяцев назад +1

    I’ve been a dog trainer for the last 6-7 years. I was a financial analyst who wrote a lot of VBA. I’m shocked and excited to see how similar python and VBA are so far. I was afraid I was in for a complete relearn, it it looks like I can write code like I was used to and just figure out the little quirks that are different (Colon after the if statement, etc. ). I’m also going through your ccna videos series. I’m looking into getting into cyber security. And trying to get the basics down before I dive in. Thanks so much.

  • @deadeyeshooter8818
    @deadeyeshooter8818 2 года назад

    Hello Chuck! First of all....You did what my previous teacher couldn't do for a pretty high salary. I'm glad I've found your channel in time, maybe i'm not totally lost after all. In my school they used every single class for torturing us mentally then somehow force the most likely raw boring staff into our head without logic or better understanding. I can't thank you enough for your precious teaching that fixes my ruined education.

  • @NoahLA
    @NoahLA 2 года назад +3

    I’m so happy he’s continuing the series!

  • @premiumleader8948
    @premiumleader8948 2 года назад +1

    Please upload more,I love these videos they make learning Python super easy,I haven’t found anyone or any source who explains Python so well as you.

  • @viccc_1767
    @viccc_1767 2 года назад +1

    Love your way of teaching. It's like Blue Clues but for adults. It helps me understand what you're teaching and you're also entertaining me while learning which makes the learning experience better.

  • @mode7206
    @mode7206 2 года назад +1

    Heeey teacher am from Ethiopia i just wnna say that i like u and u and u r best teacher ...legend. davidB too
    I hope will see u and learn more
    And i know u like Ethiopian natural coffee we like u too .... great teacher

  • @AdamPoniatowski
    @AdamPoniatowski 2 года назад +3

    in the next chapter... we'll hear about case statements... that many ifs just melts my brain

    • @NetworkChuck
      @NetworkChuck  2 года назад +1

      Python doesn’t have them!

    • @AdamPoniatowski
      @AdamPoniatowski 2 года назад +2

      @@NetworkChuck as of 3.10 they do... but its python, they just call it something different...
      match VAR:
      case 1:
      bla

  • @petergliozzo5050
    @petergliozzo5050 Год назад

    This is the best python teaching I've ever had. And i am studying it in university right now

  • @Max-bk7us
    @Max-bk7us 2 года назад +1

    I love your enthusiasm towards python, honestly infective

  • @mitchellkeller6562
    @mitchellkeller6562 2 года назад

    I've started college for programming and had little to none knowledge of this and the professors make it seem more complicated then it is and your showing it's easier then I thought it would be. Thanks for this series

  • @underthewatar1
    @underthewatar1 2 года назад +3

    Thanks for giving us great videos,I honestly mostly like how energetic you are in videos thanks so much!!!

  • @Axel-jv8wb
    @Axel-jv8wb 2 года назад +1

    i am glad that in my university we learned c language, you just need to memorize the name of some instruction (like elif) but the logic is the same

  • @kennethmantis7270
    @kennethmantis7270 Год назад

    Such a good teacher, I didn't see you in the iT pro TV 🙄 you're the only teacher I want,

  • @rodriguesjoao88
    @rodriguesjoao88 2 года назад +2

    I love your excitment explaining such a simple if, elseif, else statement. Great job! ;)

  • @Sluggaboy27
    @Sluggaboy27 Год назад

    Got it! I set a variable for whipped = input("Do you want whipped cream?
    ). Then I used an if statement for Yes and elif for no! You're a great teacher! Thanks.

  • @jadetrue
    @jadetrue 2 года назад +1

    💯Looking forward to the next episode. I absolutley love your teaching style and I cannot wait to learn more with you. Please do keep doing the videos (if you can!) 🙏

  • @kasuma6250
    @kasuma6250 2 года назад +1

    Thanks
    bro you're back with Python Episode kindly complete it

  • @uhlersoth99
    @uhlersoth99 2 года назад

    What a bundle of positive energy you have in your videos. your attitude is like sunshine on a cloudy day. You are addictive to listen to.

  • @KBeast27
    @KBeast27 6 месяцев назад

    This whole series so far has been amazing! You're a great teacher, keep up the great work! I'm mainly commenting for the RUclips Al Gore rhythm because you deserve more views. Lol

  • @link_0nroy
    @link_0nroy 2 года назад +4

    Thank you for making this python so quick!!!

  • @abhishekpatil3086
    @abhishekpatil3086 Год назад +1

    I loved this series, at the end i wanted to test something so i went ahead and added a if statement if they don't order something on the menu then quantity and total becomes 0 and the code prints goodbye!, i love this !!

  • @jayanthkadlur99
    @jayanthkadlur99 6 месяцев назад +1

    Na na na , You have the best course (That is python) ever. You are one of my favorite youtbers I have ever watched!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @spammers7431
    @spammers7431 2 года назад +3

    Love you chuck keep going❤

  • @28469
    @28469 2 года назад +2

    Bruh can you do a video on subnetting? Got my first job out of uni as a IT consultant and I would like an easy video around subnetting as you are the number 1 IT youtuber out there

  • @firedragon6292
    @firedragon6292 2 года назад +1

    lol i paused it and did it all in couple min ( the different prices i mean) so many errors forgot
    in so many places took me like 20 mins but was worth it to see it work thx man ur the only one who i found who actually makes coding fun and u even understand a humans brain like bro u actually know whats fun and wats cringe thx again keep up the good work

  • @thaliaortiz5563
    @thaliaortiz5563 2 года назад

    I have been having issues with knowing when to use nested if statements vs. elif and you cleared that right up. Thank you so much for this video!!

  • @yolow5497
    @yolow5497 2 года назад +2

    wish these python episodes came faster(and please go deeper with python than most YT-tutorials). i really enjoy your python tutorials

  • @achad_14
    @achad_14 2 года назад +1

    thank you for sharing all this knowledge Chuck!
    take care!

  • @lilme3792
    @lilme3792 2 года назад +2

    more python tutorial plkease, you're the perfect teacher for teaching python!

  • @PappaBen
    @PappaBen 2 года назад

    if name == "NetworkChuck":
    evil_status = input("Are you evil?
    ")
    if evil_status == "Yes":
    print("Retaliating for all the Bens out there, you are not welcome here " + name + ", but thank you for the lessons!")
    exit()
    else:
    print("I knew you were a good guy, NetworkChuck. Thank you for coming in and being one of the good guys!
    ")

  • @cyberwarrior3257
    @cyberwarrior3257 2 года назад

    Thank you chuck. I added the and condition along with the first if statement instead of using nested ifs.

  • @andreea45890
    @andreea45890 2 года назад +1

    I was so happy to open RUclips and see your new video, just like Xmas gifts under the tree

  • @unpredictableishere6692
    @unpredictableishere6692 2 года назад +3

    I LOVE THE GRIND MAN KEEP IT UP

  • @Rise2034
    @Rise2034 2 года назад +4

    This is the best python course ever! :) so well explained

  • @dutydriven
    @dutydriven 2 года назад +2

    Finally continue python series thnks

  • @rickygarcia8150
    @rickygarcia8150 Год назад

    Dude your class is so amazing. Ive learned a bunch from your videos and that whipped cream challenge thing had me for a loop till I figured it out. Keep doing what your doing brother.

  • @jofrankiegram
    @jofrankiegram 2 года назад +1

    Thank this is what I was waiting for this is awesome 🤩 thank you 😊

  • @earthbender731
    @earthbender731 2 года назад +1

    I learned all of parts 1,2,3,4 and 5 in one day,hope you will post more of these,they are very entertaining and so much usefull.Now I can do basics in python and I learned that all in one day,thanks to you

    • @AliAhmad-su1hw
      @AliAhmad-su1hw 2 года назад +1

      Hello
      My one has a problem i done everything in video it says price is not defined

    • @earthbender731
      @earthbender731 2 года назад

      @@AliAhmad-su1hw u need to define the prize.That means write a line in the python code that says : price = number.U can change the number to a price of your choice

  • @Pianodaddyy
    @Pianodaddyy 2 года назад +3

    Where did you go to school Chuck? I’m specializing in cybersecurity, and it feels like as my courses progress, your videos are nearly side-by-side to mine 😂

  • @krunoslavkrklec4857
    @krunoslavkrklec4857 2 года назад +1

    thanks for making the series. I love python and I just started to learn it. : )

  • @midimusicforever
    @midimusicforever 2 года назад +2

    The perfect theme song:
    Placeboing - If

  • @Renotrigger
    @Renotrigger 2 года назад +1

    In high school (80's), my nickname was "Nerd" and I took that as a badge of honor, and I now crown you as a Nerd (Never Ending Radical Dude), yes I made that up.
    Thank you.

  • @hizaack
    @hizaack 2 года назад

    Thank you brother for this privilege and opportunity. I'm enjoying these classes. I love them. God bless you brother❤️

  • @fellipefoliveira
    @fellipefoliveira 2 года назад +1

    Chuck is legendary XD. Thank you so much for the content! ^_^

  • @EgaHemachandra
    @EgaHemachandra 2 года назад

    Yeeeeeee from Monday I am going to have my python basic classes but I am already getting ready!!!!!!!! With you chuck thank youuuu

  • @Shabbyy.
    @Shabbyy. 5 месяцев назад

    thanks mr chuck: if i can try this. if order == "tea" :
    cream = input("Do you went whiphed cream?
    ")
    if cream == "yes" :
    price = 11
    elif cream == "no" :
    price = 5

  • @sevomyvrt3236
    @sevomyvrt3236 2 года назад +2

    Thank you very much for the course!

  • @Child0ne
    @Child0ne 2 года назад +1

    i love how you can write your program that you just created a bunch of different ways, Me.. I like to try to be as " Pythonic" as i can

  • @lasagne357
    @lasagne357 2 года назад +1

    Thank you for the lessons Chuck, You help us so much

  • @Mojzu
    @Mojzu 2 года назад +1

    almost 2m subs? omg i remeber when i last time wached yours movies you had under 100k sub, congrats!

  • @simplysimple7391
    @simplysimple7391 2 года назад +1

    The meme content from the previous video was 10/10, love these videos bro

  • @karlvohma
    @karlvohma 2 года назад +1

    found your channel yesterday and ive an addicition

  • @VanityOnToast
    @VanityOnToast 2 года назад

    i have learned so much from u so far. and for the whip cream challange. i did that. and on my list i have boba. so i did the same thing but it just asks what flavour boba you want. please. and seriously please. never. stop.these episodes. they are amazing i learn so much

  • @antonimisenglish5960
    @antonimisenglish5960 2 года назад +2

    Finaly hes back when i need em!

  • @mamladon7434
    @mamladon7434 2 года назад +2

    love your course

  • @claudiamanta1943
    @claudiamanta1943 5 месяцев назад

    😃 Man, you can code AND you can teach! Superb. 👏

  • @chronosVR.2763
    @chronosVR.2763 Год назад +4

    You should do a video about F-Strings. They let you add code into the string using curly braces (these -> {}{}{}{}).
    For example, print('You have $' + money +'.') would become print(f'You have ${money}.')

  • @PsychicSaw
    @PsychicSaw 7 месяцев назад

    Oh my science, you're amazing! Just starting to learn Python and you make it sooo easy and so clear and so fun... And yes, I'm always drinking coffee with you! OK diving into ep 6! Much love from Israel 🖤

  • @HolyGunsmith
    @HolyGunsmith 2 года назад

    Thank you so much for supplying everyone with this series! I was able to complete the whipped cream challenge on my first try. I am very glad that I am actually learning!!

  • @deepfrieddevelopment3123
    @deepfrieddevelopment3123 Год назад +1

    I took a much more rudimentary approach to structuring this one and figured I might share in case someone finds it helpful!
    Basically, the idea I had is that checking the name and printing the welcome message are 2 fundamentally unique tasks. So it starts like:
    name = input("What is your name? ")
    if name == "Ben":
    evil = input("Are you evil? [y/n] ")
    else:
    evil = "n"
    This initial portion takes the name, and if it's ben, sets evil to the answer of the question. If they're not ben, it just sets evil to no. Then it continues:
    if evil == n:
    print("Hello " + name + ", thank you so much for coming in today!")
    else:
    print("You're not welcome here! Get out!!")
    exit()
    This part then checks the evil state from the first process, if they're not evil it welcomes them and will continue through the script. However, if they admit to being evil, they get kicked out.
    Obviously the whole point of this video was to show that nesting if statements is a thing, and it's helpful. I thought sharing this simplified example might be nice though as doing things in a process like this is nice to avoid situations like needing 2 different welcome messages (unless you want a special message for non-evil Bens, in which case this method is worse). Just one more tool in the belt.

    • @siddeshsiddu432
      @siddeshsiddu432 Год назад

      Yess .broo its right, and also continue, cofees and this price .i am tell right or wrong .plzz answer

  • @IvanAAnnuh
    @IvanAAnnuh Год назад

    You do this with so much passion and enthusiasm, it greatly motivates me!

  • @tasliner2003
    @tasliner2003 2 года назад +1

    I will always love python with Chuck

  • @phantomsking2238
    @phantomsking2238 Год назад

    Chuck I love your programming sessions it is best in the whole world