Cs Paper
Cs Paper
SectionA
While processing, the CPU stores the data as well as instructions in its local memory
called registers."
3. a volatile memory.
is
Page 1 of 6
(07A)6 (d)(07B)16
(a)(7A)i6 (b(7B)16 (c)
12. |
Identify the purpose for which the given symbol is used in flowchart:
17. Which of the following functions will return the first two characters of a string S?
oS:2] (c) S[-2:] (d) S[:-2]
(a) S[2:]
print ("abc")
o20 and21 are ASSERTION and REASONING based questions. Mark the correct choice
as:
Page 2 of 6
(a), Both and R are True and
A R is the correct explanation of A 21
(b),Both A and R
are True and R is not the correct explanation of A20
(c). A is True but R is False
:
Reason (R) It mcans that any change or alteration in data, is mentioned in the same
place. The updated collection will be using the same address
for its storage.
1
21. Assertion(A):- Runtime error termination of
executing
Reason(R) :-If statementis syntactically correct, runtime error never occurs.
Section B
2
23.
B
-o
(A+B)'.(BC)
2
24. Differentiate between a CompilerandInterpreter.
i)
myaim="$$MY DREAM$$"
print (myaim[-4:-2:1)
i)
my string ="Believe in yourself"
print (len (my string) )
print ("Dear "+my string)
Page 3 of 6
27. Predict the output of the below code:
listl =
[10,20,30,40, 50)
list2 =list (1istl)
new list U
for i in list2:
if i%4m0:
new list.append (i)
print (new list)
28.Whatis the difference between ''and '? Explain with the hclp of an examplc. 2
Section C
if
#Statement2
print ("Please enter a positive number")
elif
#Statement 3
print ("You have entered 0")
else:
#Statement 4
Num3-Numl+Nun2
Num1 =
Num2
Nun2= Num3
print (Num2 )
a. Write input statement to accept number of terms(n)
-Statement 1
b. Write if condition to check whetherinput is
positive number or not - Statement 2
c. Write if condition to check whether input is 0 or not- Statement 3
d. Write for loop to iterate the values up to n terms -Statement 4
34 Write a python user defined function to input radius and display the area and 4
circumferenceof a circle.
(Area of circle r,
Circumference 2nr) [REPRESENT AS pi=3.14]
Page 4 of 6
inhas done the coding
using if..elif and
annerthat he himself get confused about if..else. but he has done coding in such a 4
the results and execution of the
writtenby him is given below. coding. Code
Help him in finding the output of
the code. Consider the
following code segment for the question (i) to
(iv).
x=int (input("Enter the value of x:"))
y=int (input ("Enter the value of y:"))
if x<=0:
X=X+1
else:
X=X+1
if x>0 and y>0:
print ("w")
elif x>0:
print ("X")
if y>0:
print (Y")
else:
print ("2")
()Whatletters will be printed if the user enters 0 for x and 0 fory?4 w
(ii)What letters will be printed if the user enters 1 forx and 1 for y?w
(iii)What letters will be printed if the user enters 1 forx and -1l fory?x z
(iv)What letters will be printed if the user enters 1 for x and 0 for y? vz
OR
Writea python program to input 3 numbers and displaythe greater of the numbers.
Section E
36. I)
Consider the following string school:
school= "Kendriya Vidyalaya"
What will be the output ofthe following string operations(Any Five):
(a) print (school [0:len (school) ])
(b) print (school [-7:-1])
(c) print (school [::2])
(a) print (school [len (school) -1])
(e) print (2* school)
() print (school [:3] + school (3:])
OR
I) Write the output for the following statements on the given string: