Ma list
Not revised yet
#
Ma list chii?Kana iwewe uchida kuenda kunotenga zvinhu zvakawanda, unogona kunyora zvinhu zvaukuda kunotenga
pa pepa kana mu phone
. Kana uchinge waita izvi, tinoti wanyora list
rezvaukuda kunotenga.
#
Manyorerwo e listComputer
inoziva kuti wanyora list
kana ukanyora ma square brackets
se izvi:
["Muvhuro", "Chipiri", "Chitatu"]
Tsananguro
Apa ndagadzira list
re mazuva 3 kubva pana Muvhuro kusvika pana Chitatu. Mu list
randagadzira iri, mune zvinhu 3. zvinhu izvi zvandaisa mu list
aya mashoko ane ma quotes
akapatsanurwa ne ma comma,
.
Zvii zvinobvumidzwa mu list?
Mashoko
ane ma quotes
- sokuti:
["Muvhuro","Chipiri","Chitatu"]
- Ma
nhamba
- sokuti:
[2020, 2021, 2022]
- Ma
variables
- sokuti:
muvhuro = "Muvhuro"chipiri = "Chipiri"chitatu = "Chitatu"
[muvhuro, chipiri, chitatu]
- Ukatarisa apa, ndaisa ma
variable
mulist
, asi ndatanga ndamagadzira mavariable
iwayo semashoko
zvakanaka. Kana usina kuzvinzwisisa izvi, unofana kudzokera kunoverenga nezve mavariables
kumashure kune topic yemavariables
kuti zvii zvikuitika.
#
Mashandisirwo e listKazhinji munhu anogadzira list
achida kuzorishandisa. Anogona kuda kudzima zvinhu mulist
imomo, kana kuwedzera zvimwe zvinhu. Kuti ugone kuzoshandisa list
raunenge wagadzira, unofana kuripa zita.
Unopa list
zita kunge uri kugadzira variable
.
Ngatimboti list
randagadzira kumashure ["Muvhuro", "Chipiri", "Chitatu"]
waakuda kuripa zita rekuti mazuva
, unoita se izvi
mazuva = ["Muvhuro", "Chipiri", "Chitatu"]
Zita Re list
Zita re list rinonyorwa semagadzirirwo evariable. Manyorero anoita ndeaya:
- Zita ngariite shoko rimwe chete rakabatanidzwa
- sokuti
listRangu
- usati
list Rangu
, nekuti aya mashoko maviri
- Zita ngarisaite
nhamba
- sokuti
2021 = ["Muvhuro", "Chipiri", "Chitatu"]
#
Muenzaniso: Vanhu mu kombiNgatimboti iwewe uri hwindi akarongeka we kombi, arikukwidza vanhu mukombi asi achinyora list
remazita evanhu vapinda mukombi.
Ngatimboti panguva ino mukombi maane vanhu 5, zita re list
rako rinonzi vanhuMukombi
.
Zvekuita
Mu Application ye ShonaScript
- pa
line 1
, nyora kuti:
vanhuMukombi = ["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
- pa
line 2
, nyora kuti:
nyora(vanhuMukombi)
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu
index.shona
paline 1
, nyora kuti:
vanhuMukombi = ["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
- mu
index.shona
paline 2
, nyora kuti:
nyora(vanhuMukombi)
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Kana ukaita zivi zvakanaka, unofana kuona muterminal makanzi
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
Izvi zvinoitika nekuti wagadzira list re vanhuMukombi
zvakanaka, wobva wazoudza computer
kuti inyore list iri ichishandisa nyora(vanhuMukombi)
list
#
Kuverenga zvinhu zviri mu Kana uchida kuziva kuti mu list
rako mune zvinhu zvingani, unoshandisa .zvingani()
, .vangani()
, kana .mangani()
, se izvi:
vanhuMukombi.vangani()
Zvekuita
Mu Application ye ShonaScript
- nyora
code
iri mu picture iyi - baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
nyora
code
iyi muindex.shona
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita izvi zvakanaka, unofana kuona mu terminal
makanyorwa nhamba
yezvinhu zviri mu vanhuMukombi
kuti:
5
Tsananguro
Pa Line 2
:
- tashandisa
.vangani()
panevanhuMukombi
kuti tiwanenhamba
yevanhu vari mulist
rako - tobva tagadzira variable inonzi
x
.- Tagadzira variable iyi nekuti tikuda kuzoinyora mu
terminal
tichishandisanyora()
- Tagadzira variable iyi nekuti tikuda kuzoinyora mu
#
Kuisa zvinhu mu list"Ruvarashe"
auya kuzopinda mukombi, iwewe sa hwindi waakufana kuisa zita rake mu list
rawagadzira kare rinonzi vanhuMukombi
. Tarisa pazasi kuti uonoita sei izvi:
Ita: "Ruvarashe" mu list
Mu Application ye ShonaScript
- pa
line 3
nyora kuti:
isa "Ruvarashe" mu vanhuMukombi
Kana kuti unogona kunyora:
- pa
line 3
nyora kuti:
vanhuMukombi.isa("Ruvarashe")
- pa
line 4
, nyora kuti:
nyora(vanhuMukombi)
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu
index.shona
paline 3
nyora kuti:
isa "Ruvarashe" mu vanhuMukombi
Kana kuti unogona kunyora:
- mu
index.shona
paline 3
nyora kuti:
vanhuMukombi.isa("Ruvarashe")
- mu
index.shona
paline 4
, nyora kuti:
nyora(vanhuMukombi)
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
ukaita izvi zvakanaka, unofana kuona mu terminal
makanzi:
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai", "Ruvarashe"]
Zvichireva kuti taisa zita ra "Ruvarashe" mu list
redu zvakanaka, saka mukombi maane vanhu 6
Ukateedzera zviri mu picture iyi, unofana kuona mu terminal
makanzi
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai","Ruvarashe","Tatenda"]
Tsananguro
Izvi zvinoitika nekuti nyora()
atumwa ka 2 kunyora mu terminal
:
- Atumwa kunyora usati waisa
"Ruvarashe"
na"Tatenda"
mulist
, saka pekutanganyora
anongonyora list riine vanhu 5 chete - Pazotumwa
nyora
paline 5
,"Ruvarashe"
na"Tatenda"
vanga vaiswa mulist
, sakanyora
anobva anyora vanhu vese vari 7 kusanganisira"Tatenda"
na"Ruvarashe"
#
Kubvisa zvinhu mu list"Kudzai"
asvika kwaanga achienda ne kombi, saka aakuburuka. Iwewe sa hwindi akarongeka, chibvisa zita rake kubva mu list
rako riye. Tarisa pazasi kuti uone kuti unoita sei
Ita: bvisa "Kudzai" kubva mu list
Mu Application ye ShonaScript
- pa
line 6
nyora kuti:
bvisa "Kudzai" mu vanhuMukombi
Kana kuti unogona kunyora:
- pa
line 6
nyora kuti:
vanhuMukombi.bvisa("Kudzai")
- pa
line 7
, nyora kuti:
nyora(vanhuMukombi)
Kana kuti
Mu VS Code
- mu
index.shona
paline 6
nyora kuti:
bvisa "Kudzai" mu vanhuMukombi
Kana kuti unogona kunyora:
- mu
index.shona
paline 6
nyora kuti:
vanhuMukombi.bvisa("Kudzai")
- mu
index.shona
paline 7
, nyora kuti:
nyora(vanhuMukombi)
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita izvi zvakanaka, unofana kuona muterminal
kuti:
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai","Ruvarashe","Tatenda"]["Panashe", "Tanaka", "Kupa", "Vimbai","Ruvarashe","Tatenda"]
Tsananguro
nyora(vanhuMukombi)
wepaline 2
ndiye anyora kuti:
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
- Apa hatisati taisa vanhu mukombi
nyora(vanhuMukombi)
wepaline 5
ndiye anyora kuti:
["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai","Ruvarashe","Tatenda"]
- Apa tanga taisa
"Ruvarashe"
na"Tatenda"
mu list paline 3
naline 4
. Taane vanhu 7
nyora(vanhuMukombi)
wepaline 7
ndiye anyora kuti:
["Panashe", "Tanaka", "Kupa", "Vimbai","Ruvarashe","Tatenda"]
- Apa tanga tabvisa
"Kudzai"
kubva mu list paline 6
. Tasara ne vanhu 6
list
#
Kutora chinhu kubva mu Vanhu vari mukombi yako iyi vakagara pamasiti emukombi. Masiti aya ane ma nhamba
. Vanhu vanowanzotangira kuverenga manhamba
pana 1
, asi computer
inotangira pana 0
nguva dzese
Computer
inotangira pana zero
Izvi zvakakosha kunzwisisa
Iwewe zvawaane vanhu 6 mukombi, uchati vanhu 6 ava vakagara pa masiti 6. Tarisa list
rako iri:
vanhuMukombi = ["Panashe", "Tanaka", "Kupa", "Vimbai","Ruvarashe","Tatenda"]
Iwewe unoverenga masiti evanhu seizvi
"Panashe"
aripasiti1
"Tanaka"
aripasiti2
"Kupa"
aripasiti3
"Vmbai"
aripasiti4
"Ruvarashe"
aripasiti5
"Tatenda"
aripasiti6
Asi computer
ichatangira pana zero
kwete pana 1
seizvi:
Computer
inoverenga masiti evanhu seizvi
"Panashe"
aripasitivanhuMukombi[0]
- zvichireva kuti aripasiti rechi
zero
- zvichireva kuti aripasiti rechi
"Tanaka"
aripasitivanhuMukombi[1]
"Kupa"
aripasitivanhuMukombi[2]
"Vmbai"
aripasitivanhuMukombi[3]
"Ruvarashe"
aripasitivanhuMukombi[4]
"Tatenda"
aripasitivanhuMukombi[5]
Aya ndiwo matarisiro anoitacomputer
zvinhu zviri mulist
. Unogona kutora chinhu mulist
ogadziravariable
kuti uone kuti chii chinoitika
Ita
Mu Application ye ShonaScript
- pazasi pe
code
yawambonyora, nyora kuti
munhu = vanhuMukombi[1]nyora(munhu)
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu
index.shona
, pazasi pecode
yawambonyora, nyora kuti
munhu = vanhuMukombi[1]nyora(munhu)
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita izvi zvakanaka, uchaona kuti nyora()
wekupedzisira anonyora chinhu chiri panhamba
2 mu list
rako, kwete pekutanga, nekuti chinhu chekutanga chiri pa nhamba
0 kwete 1
#
Kupinda mu listIwewe sa hwindi ane hunhu, ukuda kumhoresa munhu mumwe nemumwe arimukombi yako nezita rake nekuti unoziva mazita avo. Unoita sei? Tichaedza kuita izvi nenzira 2, asi wega uchazviona kuti ndezvipi zvirinani.
Nzira yekutanga: Shandisa nyora
pane mu wese ari mulist
Mu Application ye ShonaScript
- dzima maline ese osiya line rekutanga rakanzi:
vanhuMukombi = ["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
chinyora pa line 2
kuti:
nyora("Hesi Panashe")
enda pa line 3
onyora kuti:
nyora("Hesi Tanaka")
enda pane line
riri kutevera uchidzokorora kumhoresa munhu arimo sezvaitwa pa line 2
na line 3
, upedzisire pane line 6
. Tarisa picture iri pazasi kuti uone maitirwo azvo
nyora("Vimbai")
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu
index.shona
dzima maline ese osiya line rekutanga rakanzi:
vanhuMukombi = ["Panashe", "Tanaka", "Kudzai", "Kupa", "Vimbai"]
chinyora pa line 2
kuti:
nyora("Hesi Panashe")
enda pa line 3
onyora kuti:
nyora("Hesi Tanaka")
enda pane line
riri kutevera uchidzokorora kumhoresa munhu arimo sezvaitwa pa line 2
na line 3
, upedzisire pane line 6
. Tarisa picture iri pazasi kuti uone maitirwo azvo
nyora("Vimbai")
Kana mu list mako muine vanhu 1000, zvinoreva kuti kana uchida kuvamhoresa vese nenzira iyi, uchanyora ma line 1000 mu index.shona
uchimhoresa munhu mumwe ne mumwe.
Nzira yechipiri: Kupinda mu list
Kunonzi kupinda mu list, zvinoreva kuti tanga pane chinhu chekutanga mu list otuma computer
kuita zvauri kuda, oenda pane chechipiri, zvichingodaro kusvika pane chekupedzisira.
Tiri kuda kutuma computer
kupinda mulist. Unopinda sei? Chimbotarisa manyorero ataita pazasi:
Chii chikuitika pa line 2?
Tsananguro: Kupinda mu list
Tiri kuti pane ___ mu ___ {
. Apa tine 2 ma ___
___
wekutanga anomiriravariable
inopinda mulist
- variable inopinda mu
list
inonyorwa semanyorerwo anoitwa mavariables
akataurwa mu topic yemavariables
. Asi apa kutongonyoravariable
yekutimunhu
ndiko kutoigadzira kwacho, sakacomputer
inonzwisisa kuti apa wagadzira variable ichapinda mulist
rako
___
wechipiri anomirira zita relist
rako raukuda kupinda mariri- Ma curly brackets
{}
anoudzacomputer
kuti kana yapinda mulist, ishandisecode
irimo muma curly brackets aya
Ko pana Line 3?
Line 3
arimuma curly brackets saka zvinoreva kuti computer
ichasandisa code
iyi kana ichinge yapinda mu list
rako re vanhuMukombi
.
nyora("Hesi ", munhu)
Apa nyora()
apihwa zvekunyora zviri 2: "Hesi "
na munhu
.
"Hesi "
arimuma quotes, zvichireva kutimashoko
sakacomputer
inonzwisisa kuti "Hesi " achanyorwa muterminal
sezvaarimunhu
haasi mu ma quotes, zvichireva kuti haasimashoko
, uye haisinhamba
, sakacomputer
inonzwisisa kutimunhu
ivariable
computer
ichatsvaga kutivariable
inonzimunhu
inopinda mulist
yambogadzirwa here? Hongu, yagadzirwa paline 3
Kana computer yapinda mulist
Kana computer
yapinda mu list rako, inotanga pane chinhu chekutanga mulist rako. Saka apa inotanga pana "Panashe"
.
Kana computer iri pana "Panashe"
, variable
inonzi munhu
ichachinja kuita "Panashe"
.
munhu = "Panashe"
Computer paichashandisa line 3
nyora("Hesi ", munhu)
Apa munhu
ndi "Panashe"
, saka mu terminal
muchanyorawa kuti
Hesi Panashe
.
Kana computer
yapedza kushandisa code iri muma curly brackets{}
pana "Panashe"
, ichaenda pane chinhu chiri kutevera mu list
rako yoita sezvayaita pana "Panashe"
. Saka variable munhu
ichachinja kuita munhu = "Tanaka"
yonyora nyora("Hesi ",munhu)
, zvichingodaro kusvika yapedza nevanhu vese vari mulist rako
#
Kutsvaga chinhu mu listUnogona kutsvaga chinhu mu list
uchishandisa.muna()
, kana kuti irimu
.
Ngatimboti iwewe ukuda kutsvaga kuti "Kudzai" arimu kombi here pa list
rako, unoita seizvi:
Chii chikuitika apa?
Pa line 3
na line 4
arimoHere = vanhuMukombi.muna(munhuAkutsvagwa)arimoHere = munhuAkutsvagwa irimu vanhuMukombi
Zvikuitika apa zvakangofanana, pa line 2
, tagadzira variable
ye munhuAkutsvagwa
, tobva tati ndi "Kudzai"
.
Pa line 3
, tiri kuudza computer
kuti tarisa mu vanhuMukombi
kuti muna
variable
inonzi munhuAkutsvagwa
here, munhuAkutsvagwa
wacho ndi "Kudzai"
agadzirwa pa line 2
Pa line 4
, tangoita zvakafanana nepa line 3
, asi tikuudza computer
kuti tarisa variable
inonzi munhuAkutsvagwa
kuti irimu
vanhuMukombi
here. Iwewe unoshandisa line 3 kana line 4, zvichienderana nezvawanzwisisa
Zvekuita
Mu Application ye ShonaScript
- Nyora
code
iyoyi - baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
Nyora code
iyoyi mu index.shona
, wochiita izvi:
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita izvi zvakanaka, unofana kuona mu terminal
makanzi:
true
true
zvinoreva kuti chokwadi
, zvechokwadiwo "Kudzai" arimo mu vanhuMukombi
.
danger
Chimboedza kuchinja pana munhuAkutsvagwa = "Kudzai"
, woisa munhuAkutsvagwa = "Kudzi"
. Wodzokora zvawaita pamusoro apa.
Unofana kuona mu terminal
makanzi:
false
false
zvinoreva kuti kunyepa
`
#
Kujamba chinhu mu listNgatimboti iwewe sa hwindi wakavenga "Kupa", saka ukuda kuti ukasvika pana "Kupa" mu list
, orega kumumhoresa, ongonyarara. Unoita sei? Pane nzira 2 dzekuita izvi
Nzira1: Unoshandisa kana
, enzaniso
, na jamba
Chii chikuitika apa?🤯
Tsananguro
Line 1
Iri ndiro list
rako riye revanhu vari mukombi
Line 2
munhuWandakavenga = "Kupa"
Apa tagadzira variable
inonzi munhuWandakavenga
, tobva tati variable iyoyo ndi "Kupa"
.
Line 3
pane munhu mu vanhuMukombi {
Apa tikupinda mu list
redu riye sezvatamboita kumashure.
Line 4
kana munhu yakafanana na munhuWandakavenga {
Apa tatove mu list
kare, saka tine variable
inonzi munhu
, ichange ichichinja patinenge tichifamba kubva pane chinhu chekutanga mu list
kusvika pane chekupedzisira.
Tiri kuudza computer
kuti kana variable
munhu
yachinja kuita munhu = "Kupa"
, inobva yafanana na munhuWandakavenga
. Kana izvi zvichinge zvaitika, computer
inofana ku jamba
munhu iyeye.
Kujamba
apa zvinoreva kuti computer
icharega kushandisa code
yese ichatevera kumberi kwa jamba
mumabrackets a kana
, yobva yaenda pane munhu arikutevera mu list
Ita
Mu Application ye ShonaScript
- Nyora
code
iyoyi - baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
Nyora code
iyoyi mu index.shona
, wochiita izvi:
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita masteps aya zvakanaka, uchaona mu terminal
makanzi
Hesi PanasheHesi TanakaHesi KudzaiHesi Vimbai
"Kupa"
achajambwa ne computer
, nekuti wakamuvenga.
Nzira imwe yeku jamba chinhu mu list
Tinoshandisa kana
, zvimwe
, ne enzaniso
Chii chikuitika apa?🤯
Tsananguro
Apa tashandisa kana
na zvimwe
, kana usina kunzwisisa kuti kana
na zvimwe
vanoshanda sei, unokurudzirwa kuverenga topic ya Kana, Zimwe. Unogona kubvunza pa whatsapp mugroup kuti ubatsirwe.
Tikuudza computer
kuti ichinge yapinda mu list
, kana
variable inonzi munhu
yakafanana na munhuWandakavenga
, hapana zvaunoita. Hatina kuisa code
muma curly brackets epana kana
zvichireva kuti computer
hapana zvainoita kana tikasvika pane munhuWandakavenga
.
Asi kana varibale
inonzi munhu
isina kufanana ne variable inonzi munhuWandakavenga
, computer
ichashandisa code
iri muma brackets {}
a zvimwe
.
Ita
Mu Application ye ShonaScript
- Nyora
code
iyoyi - baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
Nyora code
iyoyi mu index.shona
, wochiita izvi:
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita masteps aya zvakanaka, uchaona mu terminal
makanzi
Hesi PanasheHesi TanakaHesi KudzaiHesi Vimbai
"Kupa"
achajambwa ne computer
zvekare, nekuti wakamuvenga
#
Kubuda mulistKana computer
ichinge yapinda mu list
, inotangira pane chinhu chekutanga kusvika pane chinhu chekupedzisira chiri mu list
imomo.
Unoshandisa buda
kubuda mu list
. Ngatomboti iwewe ukuda kumhoresa vanhu 3 chete varimukombi yako iya, obva wanyarara hako, nekuti haudi zvekunyanya kutaura taura.
Ngatironge kuti tichaita sei?
- Tichapinda mu
list
- Apa tichashandisa
code
iya yekupinda mulist
- Tichada kuverenga kuti tave pane munhu wechi
3
here
- apa tichashandisa
maths
, uchazoona zvedzimwe maths kumberi uku
- Kana tave pane munhu wechi
3
, tichabvatabuda
mulist
- apa tichashandisa
buda
Tinonyora code iyi seizvi:
Chii chikuitika apa?
Pa line 2
na line 3
- Tagadzira
variable
inonzinhambaYeVanhu
paline 2
.Variable
iyi inhamba
yatichange tichiwedzera pakuverenga vanhu tapinda mulist
.nhambaYeVanhu
iyi ichange ichiwedzera na1
kana tabva pane munhu wekutanga tichienda pane munhu wechipiri, zvichingodaro. - Tagadzira
variable
inonzinhambaYekubuda
paline 3
, bvatatinhamba
iyi ndi 3. Tichada kuzoenzanisa
variable
iyi nevariable
yenhambaYeVanhu
ichange ichiwedzera kubva pana 0 zvichienda mberi
Pa line 4
- Apa tanyora
code
yekupinda mulist
revanhuMukombi
Pa line 5
na line 6
- Tikuda kuwedzera
nhambaYeVanhu
na1
kana tave kufamba kubva pane chinhu chimwe ne chimwe mulist
. - Patinopinda mu
list
, tinotanga tiri pane munhu wekutanga, saka apa tikuudzacomputer
kutinhambaYeVanhu
ngaiwedzere na1
kubva pana0
, saka yave1
- Pa
line 6
, tikuudzacomputer
kutinyora()
zvinhu 3:"Hesi "
- aya mashoko anonyora wezvaarimunhu
- ivariable
yekupinda mulist
, saka panonyorwa zita remunhunhambaYeVanhu
- ivariable
ichange ichiwedzera na1
sekufamba kwatinenge tichiita kubva panemunhu
wekutanga mulist
tichienda mberi
Pa line 7
, line 8
, na line 9
- Apa tikushandisa
enzaniso
kuenzanisanhambaYeVanhu
nanhambaYekubuda
, kananhambaYeVanhu
yawedzera kusvika pana3
inobva yafanana nanhambaYekubuda
, saka enzaniso iyi inoitachokwadi
. - Kana
enzaniso
yaitachokwadi
,computer
inobva yashandisacode
irimuma brackets{}
epakana
. code
ichashandiswa necomputer
kanaenzaniso
irichokwadi
ndibuda
. Izvi zvinoreva kuti chibuda mulist
, chingosiyana nezvasara kumberi
Ita
Mu Application ye ShonaScript
- Nyora
code
iyoyi - baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
Nyora code
iyoyi mu index.shona
, wochiita izvi:
mu
terminal
, nyora kuti:node shona.js
wobayaenter
mu
terminal
, nyora kuti:node index.js
wobayaenter
Ukaita izvi zvakanaka, uchaona mu terminal
makanzi:
Hesi Panashe 1Hesi Tanaka 2Hesi Kudzai 3
ma nhamba
aya ekumberi kwemazita ndiwo nhambaYeVanhu
iri kuwedzera kana tapinda mu list
. nhamba
iyi paichaita 3
, computer
ichabva yabuda mu list
, ndosaka mamwe mazita asina kuzonyora mu terminal
, nekuti tanga tatobuda kare mu list