0% found this document useful (0 votes)
26 views

Cs

Uploaded by

kssajmal786
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
26 views

Cs

Uploaded by

kssajmal786
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
NANDHA CENTRAL SCHOOL XI - COMPUTER SCIENCE (083) I st 50% ASSESMENT EXAMINATION-23 aRRSZ : TIME: 3 Hrs ATE: 26 -0§ 2023, - WARKS | Q.NO Section -A ALLOCATED T |The operators that act on one operand are referred to as ‘a)Binary operator b)Unary operator c)Relation operator d) Arithmetic operator 2 |ifa=18.9 & b=3 .then all b will be evaluated as as Ja) 6.0 b) 6.3 c)0.3%d)none of these +6.3) &j=4"6 3j.then what will be the value of print (==), ‘a)True b) False e) 1 di] iUwill be the output of the Tollow' 4 Ja=bool (' ') and 5<8 then print (a) a)False b)True c) answer may vary d) none of these \ 3 |ira=2*°2 then prini(a) will be “To | 1a) 64 b) 12 ¢)256*d) none of these I | 6 {ifathellot.b~"boys!then the expression a and b wil yi a)true byfatse ejhello I boys | 7 [python files are saved with the extension as, a.python by.pe €)-py @)-pi 7 it. "7 Which ofthe following isthe correct way tgjntialize multiple variables withacommon value? | 8 |ays=yynd5 byxy=z—ds®rqziy=znd5: dhRaeyder=45, \ 9 [Error due to logic of the program |h)semantic error b)syntax error ¢)runtime error d)AIl type of errors [An appropriate statement for a loop to be repeated 50 times fa) for jin range (0,50): b ) for iin range (1,50): €)) for in range (1.51): d)) None of these 10 ! |What will be the output of the following code: i=1 11 hileGi< 10): print" Bi.end="_") =i" 2)1248 )1369 6)369 d)36 suppose a=2 ~ 2 write what will be the ouput af print ("%d" %a(a+5)) fa) 7 b)8 ©)9 d) None of these | The equivalent for loop for the following while loop is i=l philerie=20) 2 ator iin range (1 efor Lin (1.20.2): |b} for Lin range (0.20.2): _» djNone of these IF variable sum is equal to 20 and total less than 50 The above statement expressed in python as: a) if (sum==20) and (total <30): by if -20) and (total <50): jc) if (sum==20) and (total +50): $e) if (sum==20) and (total <50): Predict the output of the following code or x in range (3): \prints) 1234 8) OL ©) 012345 d) 12345 [Find the out the following : For tr in range (-600.0.200) [print trend =" *) 16 4a)-6010 400-200 }-200-400-600 e}-200-600 )-400-600 1 [17 Fhe Toop that is best suited to handle iterations is| 1 $2) while loop 6) for loop €) if d) ifelse “Tifa break statements is written inside a nested loop .on execution it will ‘aystop the |exccution of outer loop. b) stop the execution of inner loop i yver may vary - . Section-B ine looping, Write two Tooping statements that are used in python. 2 | ag. | Whats statement 2 called as? fier executing the all the given statements what will be the % | 7° Wvatue ot y? i Dhow bella _od{ fond che Ba || Write the conditional statements for the following situations: | ay jis is greater than or equal to y 2 | i) x is fess than y and x is less than z. - — - 5 5 i \Write an appropriate for oF while loop for the following situations: | |i) A toop is to be repeated 200 times. | 59 [ity A loop is tobe repeated 200 times,but the loop is to be terminated if the value of variable | 2 | |becomes 175 | | }What output Will be the following code fragment produce? n=1000 | ‘val=int(input( "enter & value:")) res=400 if (n+val>1750)else200 print(res) | ‘vif the input is 2 : | 23. jit the input is 2 | ! t [723] What is script?where can you write the python code? 2 a 2 2 What are the keywords? Write some commonly used keywords in python? Section -C What will be the output of the following ? Also state the reason, i) print (“introduction to python \n programming") ii)print("100=200") iii)print( 100/11) avelllad Write python statements for the follow [b)To print the character variable letter, ))To read a float variable into the variable discount_rate +a)To print the walue of the integer variable sum, [Find the output of the following #1 print(x) i +5-7*8/5%10 %.26"%x) ii =IHANS -3+4-78/5%10 print("%.2P"%a) [What is the difference between logical and syntactical error?give examples. | Rewrite the following program using for loop: isum=I.0 | while(i<=10): sum=sum+l i+=1 Iprint("sum is :%d % sum) —___L Find the error (s).,fany in the following program: i(("enter value of a:")) u=10.0 Iwhile(ac=3) a=a++ u=uta print("%d %a) prine(".2¢".9%u) Section-D Write a program to enter three subject marks and calculate the total of entered marks and grades lt the total marks are more than 250 then grade is’ other wise'B’ fwrite a program to calculate the factorial of a number. Write a program to check whether a number is prime or not, [A library issues books on rentall basis as 1% charge on the cost pi can be issued for 5 days without any late fee.tf the book is returned after 5 days a late fee will be charged for the above 5 days as per the given table Issue days Late fee per day 1tos 3 | 6 to 10 35 | more than 10 55 ce of the book per day A book |

You might also like