Page 132 - Information_Practice_Fliipbook_Class11
P. 132
9. DtStreintlShtltrrorlnttocinStdlwiShlShtlfoaaowinglpitctloflcodtltnipptSt:
(i)l If value == 10:
square = value*value
(ii)l if value == 10
square = value*value
(iii)lif value == 10:
square = value*value
print("The square of ", value,"is",square)
else:
print("Wrong value entered")
Ans. (i)l IncorrtcSlcnttloflktywordtl– if, elif nndlelse
If value == 10:lllllllllllllllllllllllllllllllllllll------l>l'I'loflktywordliflitlinlupptrlcntt'
l square = value*value
(ii)l ThtlhtndtrlitlnoSlStreinnStdlwiShlnlcoaonl(:)
if value == 10 llllllllllllllllllllllllllllllllllllllllllllllll---l>lcoaonleitting
l square = value*value
(iii)lNoSlindtnSinglShtltSnStetnStloflif / else / elif baocktlcorrtcSay
if value == 10:
l square = value*value
print("The square of ", value,"is",square)l--->WronglindtnSnSion
else:
print("Wrong value entered")
10. RtwriStlShtlfoaaowinglcodtlSolenktliSltxtcuSnbatlbylchnngingljutSlontlSoktn.
if x = 10:
print(x)
elif:
print(x*x)
Ans. if x == 10:
print(x)
else:
print(x*x)
11. FindlShtlouSpuSloflShtlfoaaowinglcodtltnipptSlforlShtlfoaaowinglvnauttloflytnrlprovidtdlbylShtluttr:
(i)l 2020lllllllllllllllll(ii) 2051lllllllllllll(iii) 2100
year = int(input('Enter the year of Christian Era:'))
if year % 100 == 0:
if year % 400 == 0:
print('Leap Year')
elif(year % 4 == 0):
print('Leap Year')
else:
print('Not a Leap Year')
Ans. (i)l Leap Year
(ii)l Not a Leap Year
(iii)lNolouSpuSlwiaalbtlproductd
118 Touchpad Informatics Practices-XI

