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

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

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

This entire series in a playlist:
Support me on Patreon:

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.
7. Have fun! If anything is unclear, please let me know in a comment.

Support me on Patreon:

source

By |2020-08-01T08:40:22+00:00August 1st, 2020|Python Video Tutorials|43 Comments

1. CS Dojo August 1, 2020 at 8:40 am - Reply

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.
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. Aaron Nicholas August 1, 2020 at 8:40 am - Reply

3. Paris Coroneos August 1, 2020 at 8:40 am - Reply

Bro you are a god

4. prashant gupta August 1, 2020 at 8:40 am - Reply

hi

5. Samurai Jack August 1, 2020 at 8:40 am - Reply

Me: Trying to learn how to code with CS Dojo.

6. LONE WOLF August 1, 2020 at 8:40 am - Reply

Mr.Cs dojo i just want to ask a question that do we have a button in our keyboard to run..

7. gon August 1, 2020 at 8:40 am - Reply

infraweight? xD

name = "Peter"
height_m = 2
weight_kg = 65

bmi = weight_kg / (height_m ** 2)
if bmi < 18.5:
print(name , "is infraweight")
else:
if bmi < 25:
print(name ,"has a normal weight" )
else:
print(name , "is overweight")

—– result —–

Peter is infraweight

dont judge me, i just started learning it 1 hour ago xD

8. Frankey Fish August 1, 2020 at 8:40 am - Reply

i just let my own custom built pc, the thing i created by hand, insult me by calling me fat… i feel betrayed :'(

9. pat chok August 1, 2020 at 8:40 am - Reply

Thank you

10. funny videos August 1, 2020 at 8:40 am - Reply

why he wrote ** and 2

11. Manu August 1, 2020 at 8:40 am - Reply

This guy is good, not a boring teacher at all. Learning python after a couple of years of always putting it off. Wanna see what I can do with it in a linux environment for systems, network and server administration.

Also if you guys don't want the hassle of installing programs to get an IDE going, go to https://repl.it/, you have an IDE via your browser. 🙂

12. Random stuffs August 1, 2020 at 8:40 am - Reply

Everyone please let the ad play in his all videos. He is a class teacher.

13. Asipha Artist August 1, 2020 at 8:40 am - Reply

Good for you, kids.

14. Quesartillana August 1, 2020 at 8:40 am - Reply

Yandev:

15. Lloyd Nawa Malambo August 1, 2020 at 8:40 am - Reply

Great teacher

16. NITRO August 1, 2020 at 8:40 am - Reply

it is actually showng error when i use elif statement

17. Chirayu Jain August 1, 2020 at 8:40 am - Reply

thank you a very nice video

18. Shanmuka Ganesh August 1, 2020 at 8:40 am - Reply

Sir iam from India🇮🇳
Please tell how to use python
in Android mobile
Because I have not enough money to buy any computer or
Laptop

19. asmane73 August 1, 2020 at 8:40 am - Reply

It was so.easy to do this. Thank you

20. CHENGAL RAO APPALAIAH BHATTLA August 1, 2020 at 8:40 am - Reply

Bro… thank you so much….om from india..and I'm so thankful to you…

21. Short Circuit August 1, 2020 at 8:40 am - Reply

Thanks to arduino python looks like a easy

22. Short Circuit August 1, 2020 at 8:40 am - Reply

I know arduino and I think they are quite same

23. Ethan Francis August 1, 2020 at 8:40 am - Reply

can you put them in any order

24. Jenny Tai August 1, 2020 at 8:40 am - Reply

I was in the process of learning UI/UX and thought I might pick up basic Python just so I can understand one programming language. I signed up to a TAFE course teaching Python (an Australian technical college network). Instead of teaching how to use Python, they make it super hard by talking about programming, but in the first place I have no clue about programming. (The course must have been written by an academic) Goodness me. I feel as if I'd never be able to learn Python. Luckily I found this video, after watching this video, the course material started to make sense. Why can't normal classes teach like CSDOJO, well done mate!!

25. 100 000 Subscribers with no videos August 1, 2020 at 8:40 am - Reply

How many fucking midroll ads do you fucking insert?

26. Elek Al-bazi August 1, 2020 at 8:40 am - Reply

Sorry brother ,, but the way you are teaching is not for beginners

27. Kenny FF August 1, 2020 at 8:40 am - Reply

Im 13 and Im not sure if I should start learning this now or later in my life :/

28. All In One Channel August 1, 2020 at 8:40 am - Reply

Basic Examples of If_elif Statement
https://youtu.be/BIsH1Y5Zjz0
Really common examples and easy to Understand.

29. banuprakash g August 1, 2020 at 8:40 am - Reply

Wonderful ❣️

30. arjun anand August 1, 2020 at 8:40 am - Reply

good explaination but can u make a video on how to think and become a problem solver

31. Positive Vibe August 1, 2020 at 8:40 am - Reply

Thankyou YK 🙂

32. Gottipati Bharathi August 1, 2020 at 8:40 am - Reply

This helps me a lot thank you👍

33. B-way customs August 1, 2020 at 8:40 am - Reply

I need further explanations, why are you doing all of this, what are you creating ???????
I'm just seeing a bunch of random examples. Really random

34. Christopher Lazo August 1, 2020 at 8:40 am - Reply

I have a question, I was trying to put underweight as well in the code but I can't seem to do it because it contradicts to bmi < 25. The underweight is about bmi < 18.5, since they're both the same, Python is only recognizing bmi < 25. Is there a way I can put both of it ?

35. All In One Channel August 1, 2020 at 8:40 am - Reply

Using Else Statement in python programming
https://youtu.be/TYrisKb6hrM
Really such a good idea

36. Rozana Alam August 1, 2020 at 8:40 am - Reply

y = np.array(list(map(lambda x:1 if x=="positive"

x:-1 elif x=="negative":
else 0 , y)))

where is the problem do you know ? where I have a column for y containing 3 classes positive, negative and neutral , I want to give value for positive= 1 , negative =-1 and neutral =0 then …how to fix it?

37. Harry Chopra August 1, 2020 at 8:40 am - Reply

I cant open the pdf please provide some other link ..i dont lnow why my device doesn't support that

38. Purshotam Kumar August 1, 2020 at 8:40 am - Reply
39. Arnold Von Mash August 1, 2020 at 8:40 am - Reply

I kept getting errors.
My mistake was in the beginning, instead of "name" I typed "nmae" heeheehee!!!! Thank you so much, for these videos, much APPRECIATED!

40. Tech Genius Teen August 1, 2020 at 8:40 am - Reply

could you please do the same for java?

41. Phoebe Rayy August 1, 2020 at 8:40 am - Reply

7:56 why does the second line get printed? Shouldn't only the first line get printed. I am under the impression an if else statement essentially means if this is true then do this otherwise do this..