How to Use If Else Statements in Python (Python Tutorial #2)



This entire series in a playlist: https://goo.gl/eVauVX
Keep in touch on Facebook: https://www.facebook.com/entercsdojo
Subscribe to my newsletter: https://www.csdojo.io/news
Support me on Patreon: https://www.patreon.com/csdojo

Tips:
1. Follow along as I explain to make sure you understand everything
2. Ideally, work with a friend so you can help each other when you’re stuck
3. If you want to learn faster than I talk, I’d recommend 1.25x or 1.5x speed 🙂
4. Check the outline in the comment section below if you want to skip around.
5. Download the sample files here to follow along (they are Jupyter Notebook files): https://www.csdojo.io/python2
6. To make sure you don’t miss my future tutorial videos, sign up to my newsletter: https://www.csdojo.io/news
7. Have fun! If anything is unclear, please let me know in a comment.

Keep in touch on Facebook: https://www.facebook.com/entercsdojo
Subscribe to my newsletter: https://www.csdojo.io/news
Support me on Patreon: https://www.patreon.com/csdojo

source

Avatar of CS Dojo

By CS Dojo

46 thoughts on “How to Use If Else Statements in Python (Python Tutorial #2)”
  1. Below is an outline of this video.

    Also, a few tips:
    1. Here is the playlist for this series: https://www.youtube.com/watch?v=Z1Yd7upQsXY&list=PLBZBJbE_rGRWeh5mIBhD-hhDwSEDxogDg
    2. Follow along as I explain to make sure you understand everything
    3. Ideally, work with a friend so you can help each other when you’re stuck
    4. If you want to learn faster than I talk, I’d recommend 1.25x or 1.5x speed 🙂
    5. Check the outline in the comment section below if you want to skip around.
    6. Download the sample files here to follow along (they are Jupyter Notebook files): https://www.csdojo.io/python2
    7. To make sure you don’t miss my future tutorial videos, sign up to my newsletter: https://www.csdojo.io/news
    8. Have fun! If anything is unclear, please let me know in a comment.

    0:06: The outline
    1:00: I already started learning another language. What should I do?
    1:51: Creating a new Jupyter Notebook file
    2:26: Executing a cell in Jupyter
    2:57: Deleting and adding cells in Jupyter
    4:47: How Jupyter’s kernals work
    6:18: If statements
    9:28: If-else statements
    11:32: If-elif-else statements
    15:00: If-else within if-else
    17:12: Creating a BMI calculator

  2. how to print if the height is on decimal, where should we apply float? and can u explain why did u place that next print bmi there in 6th line

  3. the jupyter in my laptop says install instead of launch and i cant open it. what's happening?

  4. I don’t usually comment on video but I just have to say you’re the best and this is my first comment on YouTube 👊🏼

  5. Honestly learning alot from your Phython tutorial a new in Data Science n hope u can help me out. The sample files are not working

  6. CS Dojo, Seriously bro, thx a lot for this explanation, you helped me to conclude a challenge in my python studies!

  7. how can you help me understand java how classes ,methods functions better, cos from you tutorial on these topics i was close but i don't know if you can use real situation to with codes to explain the classes objects functions and methods again , to know when to create a class ,when to create and method and constructors huh, i don't want to give up i want to do this please help me

  8. Great videos.
    Also, is common to see how people get disencouraged when they don't understand or underestimate what programming is, the first video at this date got 7.7M views and this one 2.1M, so, lets keep learning!!

  9. Hi the Tutor, your first video on Python was great. My first time with python was on your video and i enjoyed it following step by step practice for the first time with python. I have always love coding stuff and i would like to continue with this course to the certification level. What will be your advice becoming certified expert on python? Thanks very much as I wait for your response.

  10. Can someone please tell me what is wrong with my code?

    INPUT:

    name = "Lui Kang"

    weight_lbs = 120

    height_inch = 68

    bmi = (weight_lbs * 703) / (height_inch * height_inch)

    print(name)

    print(bmi)

    if bmi < 19:

    print("You are underweight")

    if bmi > 24:

    print("You are overweight")

    else:

    print("You are healthy")

    OUTPUT:

    Lui Kang

    18.2439446366782

    You are underweight

    You are healthy

    For some reason it'll still print "You are healthy" when I choose a weight that leads the BMI to be underweight, but it doesn't print the "You are healthy" if it is overweight.

  11. I really appreciate the simplicity of your videos. I follow along with pycharm and as a total beginner I am learning a lot.

  12. The way I kind of look at coding is when dealing with these what if statements, it's like pre-algebra. But, it reminds me of writing a check, you write out the numbers and then on the line you spell it out in words.

  13. I'm watching this in 2022 march and the current version of jupyter notebook I am using automatically gives you those four spaces after the if statement. this alone makes me have respect for any old programmer i mean imagine ctrl z-ing all this progress to what was there years ago, those people needed some hardship allowance 😅😅😅😅 anyways greetings to anyone reading this .

  14. Thank you CSDojo for this wonderful video but an observation if I may,..could you make your videos much clearer, it's blur and difficult to make out what's typed as a result couldn't really follow. Grateful if you could see to this urgently.Thanks

  15. Helllo, first of all really great videos till now,
    and second i need your help. When I type in the same codes you do at the calculation line of the bmi and i try to run it it says "TypeError: unsupported operand type(s) for ** or pow(): 'tuple' and 'int'" and when i remove the * it says the same thing for the / . I tried it in a new file but its still not working. If you have time to respond me i would be thankfull for your answer.

  16. I am trying to understand this i am starting school in April as a Software Engineer. I really need to grasp Coding test is in 9 days.

  17. Hi sir if the sequence is 1,4,9,16,25 Mathematica gives n^2 through FindSequenceFunctio. How do you do code it in Python?

  18. Hi I'm learning python but making html file in visual code studio,I'm trying to make a login page,I need to make the input type="text" Working,the button was allowing even without the box filled

  19. you explained everything so clearly except for when you got to the BMI calculator part i don't understand why you wrote print ("BMI: ") then then print (BMI) again. you didn't explain that part clearly.

  20. I understood how the if else statements work but I don't get how to make the calculator so I just copied yours

  21. can someone answer why in the BMI calculator we write :
    print("bmi: ")

    print(bmi)
    like twice? why?

Leave a Reply

Your email address will not be published.

Captcha loading...