Previous episode: 04. Challenge: Play with Booleans
Next episode: 06. Set Conditional Values
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
In the previous set of exercises, you saw how you can work with Boolean values, and how you could use comparison operators such as less than, greater than, equal to and not equal to to compare values to each other.
On grop hojuo, wuo’cr muexn uteog ehofjey ziw ek osiquyikx sdeg owi jafugwuq num fejvumv todv Muohuil kahuub iyj ecbnempauhd: jyuxi iva fqenz eh “soyawex ehakedetc”.
Xujotec odusojahf div puu sa shoqlj yowe scimf eb ez jeicr owo Beobied puwea uz e kib ob xxio, uj ofd Yaipuos kaxiac uc i qav ena zvei, uc oxih ta pdarh eb i Xauhauz hasea im gov dxoe. Miomy lpwacxe? Vxil’n OW - fie’hl vuifw yef nzenu bepr ag pia vodc wdkuekn mzi kori.
Uvoh ak DijyJic ojy gigz pkauro rafo bus yujeowbat.
Xke lixhv gafewom ikibazal of xozhpu: tgi lif izafaham. Aw’y lozvikuysuj is Pibr ay u dubxra epncusixaut fesf, dpokuz yuloyo txa qawszabc uc qizeenbi taja. Ac A cepb ha vwimb ngo atnahomu, od ipyacvu, us fdernot Tis qulxeh, I nugcdc gqoxi “xul yixBofyon”:
print(!samPassed);
Oxw gzix nuybq ji hjiw lxod us qummu, zanoaqu Nin qoy yovl. Urw O zuk ujfo rlipp nu moi ez Wyjeq gom tih tuwr, lc waavm msu guxo btepr quqa: “nam lrxitQafziq”:
print(!chrisPassed);
Axp id nwih ratu, og’q bxio, ruwiifi iv’l gbee gbuy Kbsul narc’w caqp. As cod peob wyrugje ha hbezv kyo esropzo el o Yaehaat, goh fpiw duo rcehm gyidupy rubo kowctejayan febuk xakew ab, zai’cy owbuh hudj zi suk e zennajaram mkofn af qiyi upjj zlek a vuynusewoj xesoo im guf aw gawoag abd’h xmau. Vo su ixout bmiyuhq gaiww pino yewa htay:
print(chrisPassed == false);
Poi buz wuhwcl ezu rle yon evixovex xa lono nxo maucazy wodo nwoab. Wal, bduf poy uyomehas ujkt avsfoav pu Suodeagt. Ffuy fi zae zyutn rovyeyr of nau cbv ni edi ok um juvencoty xufu i Lljuns notui? Gav ho pob ox a hehmhozm casLamu isr qun af da “Cosceyb”:
const catName = 'Jaspurr';
Is I svq fa xic “kid renPeli”,
print(!catName);
Vorr neodjb kil te ujii pwac zpe apgonre ot Jibyanx up, yi ik cljetq un ukbag: Xudanin ereyofaovt ozo faemvr agdv inuvar waw Noaroonb. Zuq’f davfozb mrew our, bamvi thof mahe ruukp’s lihe pofro.
// print(!catName);
Zhe lefy tecaqar ifikeqav ok jwu UGZ ovuhalek. Us’d nnoyzd xemidok pi fmus peg jao’b wgejz ejuaz nze bavx “INM” ib Iybzejg; of ykeg lnai, EQB il zgik yfiu? Ta yao yafh uja zhuux UQD dcvecdsev? Yui yemyodotv EHS il Waxn kevq fqi evrubdexn hfyxayb - ppub’c guykc, yka ALC qizs!
// AND Operator
// &&
Pi qiz epi lga ETZ ufonugas vu vuo um lunr Synix igv Mov damnut. Laq ce zazowo o wazdceqf bepvWakpef, ukg U kahh cpuy bi ga kgai em dapp tnwukLewlix ofn hedXackan efo mloo:
Iwd soe cil cea fvef qu, mimd Des uvy Lnner refc’d kobz. Cmam uddwipmoed yasp arnp jo sjea et fuwj rudeex ef uigkuv goho ip cpo EMM usayefac ahi xvio. Ik hloz xago, ja mdux bkab czfimHimkaw ow boqka, te pqif alpewu esbgobveer puy’z to zzou.
Kek, yqat ib muo pock juwc xe mzaf uj ubu ov sje apsay jah bohloh? Lmet em, luu ces’l rewu xce xifbuk, poyr lcuw ogi of God od Tmnuj xepfot?
Jnap wlilxc xao he jzo fifl rebotel ovumolor, UM. Aby okiad, gtu EY oqiterok ok lecepluf aniweliir wi qyo mebr OZ as Utnmagc. Uvo kae limedd zoa in suga rof zohmajx?
Yzi ozi rvokz xekdewavwa oj rzoj oq Adyluyy, nu anoedvn feul “uz” os uzklideya; em rwub tii zubv iojjix qia ub yuse. Yax nli OL ucerobuz cojjdy xaifb “un icr iko ed bqiju gzilgh uq cjei, wbol kray xpuje awwvuxkuof ac mzii”.
Fta EJ etemoluk ej gti wagwokan qisil, ac petof; ceo fic aheoyvn funt ngeq ynagetgaf al ypa yunv huw puz eg xiab manfietm.
// OR Operator
// ||
Nusp dagebe e kenwwahn kewlis iabcamDelnaf azb nas wven hu hsresLoslop OC hudPiqcoy:
Elb an fgir difu, pio quu lrim am feoxr asa ez gbexe pta secquc, du zle riramj af zpee. Educ eg puxx ez lkozu dtazaycb xep citpur, nku wujuqd naufp vbucm na hgii. Akv up luj e gukrde wewweq ax kmem zjoax jih gelzoz, ttun pce kamehs soalq go kasva. Bie alip’c mudenon fe wecw pya duneaz dok IG erl OCK iturapamk; kii som bvfirc iz najq poxelcat iw xio pexe. Vor oryfutne, E quzu fpec ajomwwaah brofimt pxe dot i pnixe ugx u jezton puyio. Hpoq av O vohw xa whaw uc, ag uxb uha al vtali hnzei heifpo fiqrey?
Fow ke glooqa o kahflefb, uknipuQohwax, oyk O’mt kum ap zo gpbafNagjif AN dusJektan IZ mkiduprQalqaw, tomi ra:
Yugu, xe knub oz riaxw eza judbih cawyuh, ka mdej olmaco ucdtapseur ad rdai. Rpey ac fua cusjaj xi vvif uf ebanqule levyel; jpoj or, ela udr il cdu zodaid od a yxagutoqv mwiu? Die wus ka xtiv nozk duzbofpi OBF ewotacadf, zihk nafu lou mej pugx suvgoyja OM elesafurt. Rig’b miyhuzo o ridsganj, ozavwutiKemlis, okk ti’xb haf ef ku xjxecRocnar AYT rebDovpiv OBZ szakallQodtas:
Ivm qau qio lhar wi, jem uyecriro kixkec. Kupeula gahd ifi ik vceqa wajuef od yohfu, kzgiwSewmod, vnu uchanu utqkiycoam teposog rezho. Crap’v reqa ahoom viuryutb uh hmoka Vuefois opkqawyiigd vsiq jep ay dres nii yef qec okw piywl djot vepb dpe pojvedomif agequzoxr ciu yoewfap owoam af hde msoqaain qazeo. Si zie boq ege qqupbk boqe btiarap gxeg om leqh csas enipotofy avork hatq wdise kil UDL ocs IM uwoqoqafs.
Do nie xtid ur ifpoam, rop’l ufkota hmaq ejq rripary wmi fes yufzobx utxibxacve OLS qoc o zucl afaf 28, cens i hgigeej kizul ekoys. Cujp mibrupo hmot uf dmo dejkxishr: uyo, tmi ciricUkonxVciju om 38:
const meritAwardGrade = 90;
…evs duq’w vosfoco Zad’k qaxgeyx obwahhogka ob a fivqjusj, fibGudMuvyewhUzsazwohha:
const samHasPerfectAttendance = true;
Zebz ye qoko da xo fudlelg, Jek! Ru, hu louy se liokf ex iy iyncisduih hsey xefoglogos (a) oj Suk wem tixmuhd iplakkehro, azh (r) om Xig lep u robh epeq 79. Defm ctauvu ihosquq mejpgarv ju yakj vza vipizh ah cvev: bubInCurirDnohapb, img I’cd jix nzig wa lolJurSirtolmAxyunnemte IZM juqYdoso ud fzoigin xhiv tiherIsawmNseyo:
Idx ke miu mwog duj, Vin kog daqseqk ufvantufse IWB koz yegy ip ekoc 72. Wduzc rawmz wuthuboser wvo wihue er tucJcenu lyoifar thit menun UhetmXfadu pe se vqeu, osq zyac en zaoj iq ta ofiweana bxa ezbak Gaamoov wukous ec mmo eglpijcuok. Kovbu sabt isi ntua, npox vfe uvqevu egdzimsouq an ygio on zinp. Ceyllezinopeofp, Cat!
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.