Page 133 - Information_Practice_Fliipbook_Class11
P. 133
E. Lab Exercise questions:
1. WriStlnlprogrnelShnSlncctpStlShrttlnuebtrtlfroelnluttrlinStrncSivtaylnndlditpanylShtelinlntctndinglordtr.
Ans. '''
Objective: To display the numbers in ascending order
Inputs:
num1, num2, num3: numbers to be arranged in ascending order
Ouput: Numbers in ascending order
'''
num1 = int(input('Enter first number: '))
num2 = int(input('Enter second number: '))
num3 = int(input('Enter third number: '))
print('The numbers in ASCENDING order are: ')
if num1 < num2:
if num2 < num3:
print(num1, num2, num3)
else:
if num1 < num3:
print(num1, num3, num2)
else:
print(num3, num1, num2)
else:
if num3 < num2:
print(num3, num2, num1)
else:
if num3 < num1:
print(num2, num3, num1)
else:
print(num2, num1, num3)
l nepatlOuSpuS:
Enter first number: 45
Enter second number: -3
Enter third number: 10
The numbers in ASCENDING order are:
-3 10 45
Assertion and Reasoning Based Questions
The following questions are assertion(A) and reasoning(R) based. Mark the correct choice as
a. Both A and R are true and R is the correct explanation of A
b. Both A and R are true and R is not the correct explanation of A
c. A is true but R is false
d. A is false but R is true
1. AtttrSion(A):l Inlnlprogrne,lnlttSlofltSnStetnStlenylnoSlbtltxtcuStdltvtnlonct.
Rtntoning(R):l lInlShtlcnttloflShtlcondiSionnalfaowloflnlprogrne,lShtltSnStetnStlwiaalbtltxtcuStdlonayliflShtlcondiSionlitl
Trut.
2. AtttrSion(A):l CondiSionnaltSnStetnStlnndliStrnSivtltSnStetnStlnrtltxnepattloflcoepoundltSnStetnSt.
Rtntoning(R):l lCondiSionnaltSnStetnStlnrtltxtcuStdlonaylwhtnlnlpnrSicuanrlcondiSionltptcifitdlinlShtlhtndtrlcanuttlitl
tnSitfitd.l
Ans. 1.ln 2.lb
Conditonnal SnStetnSt 119

