Enzaniso
#
Enzaniso chii?Not yet Revised
Enzaniso
dzinoshandiswa kana uchida kuenzanisa
ma variables
2.
Ngatomboti une 2 mavariables
awagadzira kare variableYekutanga
na variableYechipiri
.
Kana uchishandisa enzaniso
, unenge uchitora variable
yekutanga, oienzanisa
ne imwe variable
. Pane enzaniso
dzemhando 3.
Apa, unogona kutora variableYekutanga
uchida kuona zvinhu 3 izvi:
Mhando yeenzaniso
- Yakafanana na
variableYechipiri
here? - Idiki pane
variableYechipiri
here? - Ihombe kudarika/kupfuura
variableYechipiri
here?
enzaniso
#
Mashandisirwo e Mashandisirwo chaiwo e enzaniso
uchazomaoona kana waverenga topic ye Kana, Zvimwe
. Asi panguva ino unogona kumboona zvinoitika panenge pachishandiswa enzaniso
.
Chii chikuitika apa?🤯
Tsananguro
Line 1 na Line 2
variableYekutanga = 5variableYechipiri = 6
Tatanga nekugadzira ma variable
2:variableYekutanga
na variableYechipiri
. Ndiwo ma variable
atiri kuda kuzoenzanisa
Line 4 na Line 5
zvakafananaHere = variableYekutanga yakafanana na variableYechipirinyora(zvakafananaHere)
Apa tiri kuda kuona kuti variableYekutanga
yakafanana na variableYechipiri
here, saka tashandisa yakafanana na
.
Ukaenzanisa ma variable
aya, unofana kuona kuti akaenzana here kana kuti kwete.
pa line 4
tanga tichienzanisa variableYekutanga
na variableYechipiri
, pakuenzanisa kwatiri kuita, tinogona kuona kuti ichokwadi
kana kuti kunyepa
.
Kuti iwewe ugone kuzoona kuti chii chaitiki pataenzanisa, uchashandisa nyora()
.
Tagadzira variable
inonzi zvakafananaHere
tichibva taita kuti variable iyoyo iite zvinhu zvichabuda pakuenzanisa ma variableYekutanga
na variableYechipiri
.
Tinoita izvi nekuti tikuda kuzonyora variable
iyoyo tione kuti chii chaitika pataenzanisa.
Chiita izvi wega unone zvinoitika
Zvekuita
Mu Application ye ShonaScript
- nyora kuti:
nyora: ``` variableYekutanga = 5 variableYechipiri = 6 zvakafananaHere = variableYekutanga akafanana na variableYechipiri nyora(zvakafananaHere) ```
- baya bhatani re round riri pazasi pe screen
Kana kuti
Mu VS Code
- mu file rakanzi
index.shona
nyora:variableYekutanga = 5variableYechipiri = 6zvakafananaHere = variableYekutanga akafanana na variableYechipirinyora(zvakafananaHere)
- mu
terminal
nyora kutinode shona.js
, wobayaenter
- mu
terminal
zvekare, nyora kutinode index.js
, wobayaenter
Ukaita masteps aya zvakanaka, unofana kuona mu terminal makanzi
false
Zvichireva kuti kunyepa
. Ukatarisawo variableYekutanga
ndi 5, na variableYechipiri
ndi 6 havana kuenzana saka zvechokwadi kuti 5 akafanana na 6 kunyepa.
Tsananguro
Line 7 na Line 8
Matsanangurirwo aitwa pa line 4 na line 5 akafanana ne matsanangurirwo epa line 7 na line 8. Asi changochinja ndechekuti tiri kuda kuona kuti variableYekutanga
idiki here pana variableYechipiri
.
Ukadzokorora masteps 3 arimu box re green rakanzi Ita, unofana kuona mu terminal
makanzi:
true
true
zvireva kuti ichokwadi
. Zvechokwadiwo variableYekutanga
(5), idiki pane variableYechipiri
(6)
Line 10 na Line 11
Matsanangurirwo aitwa pa line 4 na line 5 akafanana ne matsanangurirwo epa line 7 na line 8. Asi changochinja ndechekuti tiri kuda kuona kuti variableYekutanga
ihombe here pana variableYechipiri
.
Ukadzokorora masteps 3 arimu box re green rakanzi Ita, unofana kuona mu terminal
makanazi:
false
False
zvireva kuti kunyepa. Zvechokwadi variableYekutanga
(5), haasi muhombe pane variableYechipiri
(6)
Enzaniso dzinoshandiswa pakawanda wanda sezvauchazoona ukaramba uchiverenga