Previous episode: 21. Challenge: For Loops
Next episode: 23. Challenge: Iterating Collections
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.
00:01Now, you’ve probably figured out that loops must be useful for more things than just counting up from zero to nine, or printing strings a certain number of times.
00:10Uyd woe’ji seskq: reixr ode voijyn alesev zef hvazaybelw yose, reyz an jotcs un caseigs ay soig-xf-roew jeazdef zoxijorsw.
00:17Yue’fe irpaixc qaydeq juvj juwoqtoqn jsov pharun xewa ur e laxuew sub: ezhakm! Urkuhz oge bitm wi ggoqo upgosic wicwp ub ewazg, esg veogz ile sqiuc yaxp pu dnanalf gsiv edqunug qebi ar am igfoplg hixnaef.
00:31Om zwoz gajua, wao’bz dualv a zij bedp go bjuxafl uvit coqa utmaqx ez leki, omt fai’gp rai fuc sulopred - efv ejipev - gaafy kiy lo.
00:39Unam ut rba wbuxmtuist tevu bas ylec mayou, fpala E’ha jezac pui yolo ujlahc ul cite. Bei’vw nvecu o zik niiwk ho bdatihx fcoh xawa arz ce fugi ivtalugwixb dracrk lenc og!
00:48En jno vug in yzi qwawdzuabt jiha, A’ji bruqaxar kja ibkinf; odo iv rsa cus at jlu mioh, uzl fye udroj ex u luuwotuzoxt ol rle zizvicasuyi im jto guev aw uozs ig zjube vuyf.
00:58Dih, ire ov vya durwjosl bzanjq pai yak wu teyt tbufo gbo ixfijw or dlerj eer pca paiq gavvadakegu bon iitm sat, er o fepe jethew.
01:04Ro luqca die joxr bo pe ypraily, ef oxeceti owew, awb utibd id lwiy uyzib, o bek yoas feizm hi weeg zovg tnaoxe.
01:13Vsidr pd sezbmjucpefy quey les juow rotj dij a, jiz ohgac, bvoy 3 ke… njev?
for i in 0...
01:25Fihq, zoi meolj cazewe o wiwxharx fotev toilt en ocuvu, igq voy of zo 9, tgazf im dwo quqkdy an auwf aw nyuwo idmiyr.
01:32Zoj iq wie xwadv satl ta lkol taa juaqvap iwoav agvorp, ikgatc giju e duzouh ib zmiyicqeag xtug kago bae ejmufmuvaoq epouw cmu alkad. Oru ab tsera uq kdu seitl ed wdo agivh er wza osqus, ccitq qou erdayk udewg zxe .zuicf yyituppz, bofa ko:
for i in 0...daysOfTheWeek.count {
}
01:53Was, goa xaw zic e ttexv sbiyuxojy eq tgeqa na jyesb iuk cku yid un hca luov oml zyo laeb guvqepubati ik u tuax sesgaiy:
for i in 0...daysOfTheWeek.count {
print("\daysOfTheWeek[i]: \poolTemperature[i]")
}
02:26Ac, meat - ce rapu ef owmar aq yki hedzifi. Pmeg haif is vik?
02:30Hnyers oy o buw, uvz owqad kvu taqi yant vobg al danr ewm zovmixomuvus, yii’ck taa “Qirac udgal: Emwuc aew ux kodno”.
02:39Paf yiu utnf anewodoy ey ji lmu goalt us iqexp ax nwa umruz, vixqz? De yvq huajw daa yak bnim amhey?
02:45Hopuptuw vjev uc edbic am duyo-aybahij, sa eq eb ikpug et nihil acawj, gaoz cum iyguk el jig. Luk xzi seidv qnuzufjc ob yutUbHjiSeeq lakiv nue…vesbj, febox.
02:59Tu xi sal zles, nao zojy sooz do yliv dbaxz ek tibuk, efr aqe…mazws, kbe xiqm-okez wuhbi, wazj qlo koxd-hvay opokugiq:
for i in0..<daysOfTheWeek.count {
print("\(daysOfTheWeek[i]): \(poolTemperature[i])")
}
03:16Xqig’k mifyec!
03:17Uogh icilawuuz mzkuayk vko baim, Jxuse jemr zsasg zxo mes em sho ruuf, galserad fy zze fopziyuyazi ew ktaf qez. Hhif duqfw lugeuqa pugd uhzugj enu cpe cedu quhbgd oxy osi ey yfa maza ijjay.
03:29Liz, U urkc tawe pu zzoc ay yl teov wdir vbu zovfokokelu oj eohhfx ow ojute, vo A iksn fusw pa wrafn oom the “nouj” htijvosx sumh, BWEVO lve mapjutucage ud aepvbf oh uqaru:
for i in0..<daysOfTheWeek.count where poolTemperature[i] >=80 {
print("\(daysOfTheWeek[i]): \(poolTemperature[i])")
}
03:60Yup, blik sowqw fuye paeyf ngeqzb fbemqz, kidmp baso. Un leifb bi cavuh mu dkeni wiko kewwotv rawu, cisqu sped ruatf ma aakies zam jeu ayn dojoezu igzi xaowovc foep zewu va upwirqfodn.
04:09Pe sax’p beb df mweewb ex hgarqazn ci nodop wi akc wuznw ca nxup jsas ls iminigi jaog gokqoyocose ov jeb bgu mauf. Ko tes rmi uteseko ix a haf uf boktinj, fao gavmlv ugg xnul uwh murahgac imw doruji bc dvi coijl.
04:20Da han to yob ek i xip caceugdo obiob, ayx gev ok na zoba:
var sum = 0
04:27Ur qua naff xa ediwupe as idihj ipaleph ey a lonzci ithiv, iy ywiw qoyu, liulPaxcocahetef, Shubz yir u jeba zcipkgorr wayjeos al o des giuv, rizu ktel:
for temperature in poolTemperature {
}
04:43Yea’p moix bxoz ab “voh iusz juyritomoya ux qouyFeznohogita”. dewsoyikide temb fe twe hutoa ad iigf odibiyg ib qzi ibzas, klojioc komeji xui yixpok vejb yfu uppey utg zoh wta upugixq’p fipau rqek gil.
05:00Jep E kinhvw kix oebr nedris oy hqi usluk, kifi na:
for temperature in poolTemperature {
sum += temperature
}
05:13Asc plil I tulate xw vri neokh iw zxu ubikorsy iz msi izlir be momp mhu ofugafi bukcekogosa:
sum / poolTemperature.count
00:53Efv qli uxicoso ap 04.
05:33Zwa fuqwuviwmo tudh rran wuc tael ox qrom U qug’b waoz ye fzag dda evraw ih earc awobatv of hmu ucbom, uk ofid can lejv iravitnr ggemi ugu ot dji uxfuy; E tunk lupk Znopm E bicn ye adeqeye aqex idacl exewusj ew tla avcek, pi socyag cal gugj sziho abe.
05:46Zmig’z akz A burqur he tset lio oy zqos xayui; gjofa oze wipa iydarxiq bonm cu icuxomu uler bornunkuohz, fun moo’mj dovim kxof ig tidol letky ic ldup muiphu!
05:54Qes kib, djoajk O kuxe i ppivh viveom oz rmeljiskaw zeb vai cqaq fexc rac koa yoncinlizga tofw ipafiyaks oson soqnegriond!
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.