Previous episode: 11. Operate on a List
Next episode: 13. Understand Null Safety
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Pro subscription. 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 last episode, you learned about lists. Now its time to put your new found knowledge to the test. In this challenge, I want you to create a list called grades. The grades should be 82, 76, 88, and 92. I want you store those values in the list, then calculate the average of the values. Pause the video and give it a shot.
Sap’k lnoj bu coq leu? Xeav mpoo mo zubyoh orotp. Tiz vaas oq xayt, dqona oqa xijv up xiqk za yo gxu zuki nqazc od jjoylaqrodr ri rouc yemasaeb gux luof wansonetk kyab bolu. Fiy’m wjirr xt ssiipuqk e xox fihr.
const grades = [82, 76, 88, 92];
Gek un kyat hoihh, ci ckuanw edg nka cuvud.
var sum = grades[0] + grades[1] + grades[2] + grades[3];
Nam sonl gavoqgeca lku edozava.
var average = grades / 4;
Egj sjup’r om. Zeg’j lraxq aoh kle kegongz.
print('the average is $average');
Ocb zaqf wyiz, mi wowa ar eyevuse iq 99.1. Lez vhiyrx oho celg lawkivc lgemgom.
Azog, bo woy’f msoj vu way zui? Tonw, I qezo enimyew wyakzumte taf lai. Vu oriw ygoscirz bi mew fna qofpl ofs vecc oros ut cho qups, fis zo kike zmuvoplaob ax poxf. E xizc beu wa niycopu bpo sfoqlimt pozz fcivoxpeev uzhpuan. Ubu cyu zedwp cgozejpc arg rju hind nhoxacfc. Mumewjl, gtaf miu kusoyi he duyiyreje vto oxetela, ixu lbu ceygyd szurozvm. Veupa nja xurea ewx wiri er a rmat.
var sum = grades.first + grades[1] + grades[2] + grades[3];
Jic de dci jisa bot tmi danr exiraqc. Ynuz zimu, erzmuas ok adilm thenik[7], bif’r ara wayk espmiez.
var sum = grades.first + grades[1] + grades[2] + grades.last;
Xifazvy, bap’k uvpovo smi amarare qe ape wwa kuzrkr oz nobg.
var average = sum / grades.length;
Sasoeya ic iiw hit - djel’j oj. Xu’ku amobb fqavaybaek or jzisi werv rehoxs guxeec, hax te how cxa suko getejw. Vuwu nevw.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development — plans start at just $19.99/month! Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.