Page 108 - Gujrati Play V2.0 Class 7 Flipbook
P. 108
WÃkhkuõík «kuøkúk{ hLk fhðkÚke, ykÃkýLku Lke[u {wsçkLkwt ykWxÃkwx {¤u Au:
Output
Enter the marks: 60
Passed with C grade
Enter the marks: 87
Passed with A grade
Enter the marks: 30
Sorry!!!, You failed the exam.
Enter the marks: 79
Passed with B grade
ÃkwLkhkðíkoLk
if Mxux{uLx yu MkkiÚke Mkh¤ þhíke Mxux{uLx Au.
if…else Mxux{uLx{kt, òu þhík Mkk[wt ÚkkÞ Au, íkku if Mxux{uLx ÃkAeLkku RLzuLxuz ç÷kuf yuÂõÍõÞwx ÚkkÞ Au, yLÞÚkk else
Mxux{uLx ÃkAeLkku RLzuLxuz ç÷kuf yuÂõÍõÞwx ÚkkÞ Au.
ÃkkÞÚkkuLk LkuMxuz if Mxux{uLxLku {tsqhe ykÃku Au.
if…elif…else Mkeze ykÃkýLku çknwrðÄ rMÚkríkykuLkwt Ãkheûký fhðk{kt {ËË fhu Au yLku WÃkhÚke Lke[u MkwÄeLkku yr¼øk{ yLkwMkhu
Au.
yÇÞkMk
A. Mkk[k rðfÕÃk Ãkh ( ) Lke rLkþkLke fhku.
1. Lke[uLkk fkuzLkwt ykWxÃkwx þwt nþu:
x = 10
if x > 5:
print("x is greater than 5")
a. x 5 fhíkk {kuxku Au b. 10 yu 5 fhíkk {kuxku Au
c. ftR AkÃkðk{kt ykðþu Lknª d. yk{ktÚke fkuR Lknª
2. òu x = 3 nkuÞ íkku Lke[uLkk fkuzLkwt ykWxÃkwx þwt nþu:
if (x % 2) == 0:
print("x is even")
106 Play (Ver. 2.0)-VII

