Andrememberthatyoudon't necessarilyhavetousedifferentnotebooktofollowthiscourseyoucanuse, forexample, partcharm, whichis a popular I d forpython.
Afterthat, I'm gonnacoverif l statementshowtousethemandwhattheyare.
Andbytheendofthisvideo, you'llbeabletocreate a simple B m I calculator, whichcantellif a personisoverweightornot, giventheperson's heightandweight, I'm gonnaputontheoutlineoffthisvideobelow, soyoudon't havetowatchthewholethingifyoudon't wantto.
Andyoucangotoseesojodotioslashpythontotodownloadthesimplefiles I createinthisvideo.
Allright.
Firstofall, letmeanswer a question I receivedonmylastvideo.
Should I keepgoingorstartanotherlanguagelikePython?
So I wantedtoanswerthisparticularquestionbecause I thoughtsomeotherpeoplemighthavethesamequestion.
Maybeyoustartedlearning c++ orjobalreadyonyourwondering.
Should I keepgoingwithit, orshould I takethiscourseforPythoninstead?
I wouldsayKeepgoingwithwhateveryou'redoing, aslongasyouenjoyandthenifyouwant, youcantakethiscourseatthesametimebecausesomeoftheconcepts I'llteacharegonnabethesameregardlessofwhichlanguageyou'reusing.
So, forexample, themethodforswappingtwovariables I talkedaboutinthelastvideoYoucanusethatin c++ orJavaorinanyotherlanguageyou'relining.
Itseeslesson D onthislineoutsidetheEastblock, andweseethatseesListen, DeeandoutsidetheEastblockononcewechangethevalueof C 25 sothatseaisnotlessthan D, weshouldbeabletoseethesetwolinesinsteadonwedoseeit's notlessAndyand I don't thinkseeslessthan D.
Take a lookatanotherexamplehereisequaltosevenon F isequaltoeight.
Sowe'regonnawriteprettymuchthesamethingafterthat.
Soifheislessthan F, thenPrinceislessthan f onelse.
Now, ifyouwanttocheckifheisequalto F similartothewaywecancheckif a islessthan F, weneedtousethedoubleequalsign.
Soifyou'renotsureaboutwhichonetouse, justrememberthatinthislinewe'renotassigning f T e.
We'reevaluatinginstead, if e isequalto F.
SothiswholeBlocksaysifhe's lessan f printthisline, andifthat's notthecase, checkthenextcondition.
If e isequalto F.
Thenprintthislinerighthere.
Princeisequalto F on.
Ifnoneoftheseconditionsaretrue, soit's nottrue.
Thatislessan F onhe's equalto f.
Thenelseprintisgreaterthan F becausethat's theonlypossibilitythat's lefthere.
Nowlet's justmakesurethiswholeblockworks.
Currentlyheislessthanifso, weseetheselessan f onwhatifisequalto f so e and F orbothgotoeight, thenweseeeasygoto f righthereonWhatifheisgreaterthan F SoEast 10 on F iseight.
WeseeeaseGreatAdam F righthereandactuallyaftertheIfKlauswecouldhavemultiple l ifcausessoafterthefirst l.
Ifwecanwrite l iflet's say e greaterthan f plus 10.
Sothisjustmeans e isgreaterthan F bye.
Morethan 10.
Sorightnowhe's notgreaterthan F bymorethan 10.
Weshouldstillseehe's greaterthan 10.
Oncewerunthiscellandwedoononcewechanged e to, forexample, 20.
Well, see, he's greaterthan F bymorethan 10.
Sothere's actuallyanotherwaytodealwiththreeormoreseparatecaseswithoutusingthe L ifclauses, sotoshowyou.
Let's definenewviralshere H and G sevenandeight.
Sowe'regonnawriteif G islessthan a TSHcolon.
Print G islessthan a tch, andsofarit's thesame.
Butafterthis, we'regonnawriteelseinsteadoff.
IfandwithinthiselseClaus, wecancreate a newifcloseandsay, if G isequalto H, thedoubleeaglesignPrint G isequalto H andafterthatelse, colonprint G isgreaterthan H, solet's seehowthisblockworks.
First, we'recheckingif G islessthan a TSH, andifthat's thecase, weprint G islessthan a tchon.
G islessthaneight, sowishyousee d islessthan a tchwedoonIfwehave G beingequalto H, weshouldsee G isequaltoage, andweseethatonIf G isgreaterthanage, weshouldseethislinebeingprinted.
WedoOkay, let's notcreate a simple B M I calculator.
B m.
I isbasically a numberthatcantellif a personisoverweightornot, dependingontheirheightandweight.
Solet's say, hypotheticallyspeaking, wehave a personnamed y K onhisheightinmetersagain, hypotheticallyspeakingistwometerson.
If b m I isgreaterthanorequalto 25 we'regoingtoparadethispersonisoverweight.
Let's seeif y queisoverweighthere.
Okay, he's not.
Butwhatifhehad 110 kilogramsoff?
Wait, They'rehis B m.
I wouldbe 27.5.
AndwhyKaywouldbeoverweight.
Okay, ifyouliketosupportmeso I cankeepmakingvideoslikethisfulltime, justgotoseeestellejoedotioslash p a t tofindmypictureonpageon.
Ifyouwanttomakesurethatyoudon't missmyfuturevideoslikethisone, justgotosiestajoedotioslashnewstosignuptomynewsletteronIfyouwanttodownloadsomesimplefilesfromthisvideo, goto C s.