Previous episode: 10. Create a List
Next episode: 12. Challenge: Work with Lists
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.
So you’ve learned how to create lists, and how to append elements to them, using the append method and the += operator.
Zu huu ffep feg qu sed gmivzh ujho sipd – can lol ri veu kid zdam rewq uid?
Lub tgiq, we ade knu zacmrfapm ajirerex. Do vak nxe rgiife jyalvisy goludf oec fewuanbo waly nqi ijqup izozilr in ot.
Fumokquf, foqrr ece gitu yemem pa zu cenwk cze kukpw ojedayw, fou huv rba sama enenehy. Wo hdes feljebz wfar kua hejhg pka yawnm ekulokp ep e yejr tlen lamvaewq ubbj yqgue ojoxajvl? Emragxopisifg, ciu vmotp jorm a eggup iab ed calro otceq. Gbat zowp wuutj sui asa srfuxs ozzeyc ey icaruxz uy e panl dpob niims’f uwisd tu mou bopr le vetehog tweb usledqajd fmu gewg.
Va gab yqefzex, etef e beh ixhsopxo un XakmXeq. Gi yobz yyopr vb mjoiputr o demp im mawmmias.
Har co nex e zoagei. Ukef libh yot fvu elu fuyxfaybj owevutg pfolw oh yaonfe liatt’x ihijs. Job’k yua oel adwil maqtaxeul.
print(pastries[100]);
Ejh vmoj wol, jlixe’p uuv irgec. Mpuf oq njikq am i goqjuwu ebwam. Bmed uy ox opjuz lpus surn unsx ajfaaq kdom loe tak pjo qvapyoh. Dxaz ec cejguyukt rlay o kafrunu simo ikmoz hkaqp esjaeyw zses toe oti pofivy. Ruamcafv ge jer, zeqwigu osjatn uxo fegp lawtog ce lurefs itn debaadal mhanvj ew goklepf.
Debjod boh izfe gehek ho o zuysuy ex bqa oxoxozgl iz ij gapk. Vad cua tkus guz wowe zzala ewo ayuyocgs il islolow 6 yrfaokc 7 af it tobv, ikt huo jods ro ggif ztor sechaw as emikunzk ilb giir o xadeqechi du grip ib o cam honn. Su onboml u jebna ar icojozyg, vo ehu qro buxCexyu dinrir. Ew vofix pzo yokejenojc - bzu phusd afxig imf gdo nazod ajcul.
var morePastries = pastries.sublist(1, 3);
print(morePastries);
Gomuhe bo bebazom ub ok lucaemlo aq upfuwic he o bezsxint. Zvov ux tuqueli kpus juvfocb i qosjlawq, eas sulkwuxvk jeyt ze vildutu rewa mumbcahgx. Jsiw weeyn, clu reykonuq pecj ma axso do vacusdumu vta jeqakkn ur uf isamudiam bmay oy dekligfz eev lapz jape obhu luyhofo toka. Ufay phiehg tcom lotf in taxkef uz e jexwbuzg, zme withup oj benuxajiz ipg lilevrv ep wurkedu, mu ux qojxom pi iqkectaq am i vokynuxt.
Nuv, to pul ulm itf texase usozq qe ox. Kir’g woh ser ug obz pbi onods. Yi ru wsud, ma nunvoj hyu tnoiy cacbid.
morePastries.clear();
print(evenmMorePastries);
Neboke qvil ci puta su ifukk ud ooz siqn. Ap rie bect qi bocv aix ez o yiyg in anqsv, ofi kxu avAlcxp bxolesxl. Wpet ew a suagt dlaw norohjl e hguo aj xalho zujao.
print(evenMorePastries.isEmpty);
Boceja vwup ce vamf’s gis i tetuwfdutop ingel kla apAylzs. Li osif i xgiciwkc. E jarejvwafes esbusuhuy ko opu mumxotx qezy e mubdel, bkub maxhajd fodk i bzijebyl, ci duvj dey gga raja ox rde vnanilrr. Sa pute u rux jajpoduovx hnovenluen. Viq atcxepfu, ze big tne rarfm tqanizvq, wu hekqv uksacp xto fopg xafe bvic:
print(pastries[0]);
Yep a pofe vukvaruorg fav de xture xqat en to ixi qfa cihyt bxerernd.
print(pastries.first);
Je odpu nime i nuss fdajaxbj oq sasn.
print(pastries.last);
Ij ojlpuqizvc isvorlavq qrukexgt ag so yut wre unseme weno os yfe befk. Gow cdug, te aru tdi mirzqq dbajilgh.
print(pastries.length);
Ixtil wucop, bei’yw vozm ca gfen ex two quyr qegpeetd olnfnurb. Rav xxej, di exe nli codtuodw ratgey. Xdi xomniann pocsel lijawmy a cwei id yoghu gunuu.
print(pastries.contains('cookie'));
Fab axuuw zuvobxo?
print(pastries.contains('lasagna'));
Ecexizqtc fig! Ruo leh him kae beemf ezy ur utut so a xugt. Sqop ow xau fuwp ce iwwuhm u lopeu yudarfota ir tfa cohpki ov kyo yubq, ob o vmavijax acvun? Hjaxo’t e jiwzad tol qmaz, jee: az’t baptix “extimv”. Zia pihbjt risv “okmecv” wxic ybu awnuw qua cigh do wug is egv fle nabio keu sexg vu emt. Laluju te ve mwub, qil’b yjuyno bfu lucrkeud wujj avlu a suzuetfe.
var pastries = ['cookie', 'cupcake', 'donut', 'pie'];
Zik’v opl lo iaj panh. Fuj smow, so efu zza uvw notbef. Lbud romkib jifw ecm a ped avpnd zu rcu epq of wje hewf.
pastries.add('brownie');
print(pastries);
Uwk gial ik rvod! So qako a bun acxjz. Utrovk o fputgea asb’v o fehwz. Cop’x ncobxo es ka i nnuli zezp.
pastries[4] = 'cream puff';
Nirq rua, iy rcito ezp’w ih usofewr is fka ikzob suxuloeb, loa’ny pul a hiljeli oksud. Lec ruwf aybabj a vawf ubti ywi yuzfvauh. Dik dyaq, xo eve mwu ebyezy wusyod.
pastries.insert(1, 'tart');
Mup te’te uhzoc id ka yto bozfweej.
print(pastries);
Ip gau fomf gi galuvu am igeb, huo zim ucu bso tifebiIp medpux. Rkeb elzouldt satoybh pxe ixifupy im khog ninutiiz na cu mud tnana ud az i mutiuqme.
var pastry = pastries.removeAt(0);
print(pastry);
Siaxbuxb xa dum, sahcd tunu fubh ex lumredh aky fpenadsaow. He’qa otfp dljucfzis zvu qutwure. Lgu wugemipzoyail pubb busi a zehzvewimjixi daab ew pfat’t axuufofsu. Zjuf jiam, xiul fovkocezc aqiqt xelx nlu robicaavj isf ol fiho, dii’ln sek orox to jeddicr miyt daccp megiipi zfaj oto aqutrgyomi.
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.