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

XII CS PractisePaper 5

This document contains a 3 hour exam paper for Class XII Computer Science students. It has 4 parts with multiple choice and long answer questions. Part A contains 15 1-mark questions on Python concepts like strings, lists, functions, file handling etc. Part B has 10 2-mark questions involving Python programs and network concepts. Part C contains 5 3-mark questions requiring longer answers around Python programs and algorithms. Part D has 5 4-mark questions involving plotting graphs, network design, expressions and data structures.

Uploaded by

ekta shroff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

XII CS PractisePaper 5

This document contains a 3 hour exam paper for Class XII Computer Science students. It has 4 parts with multiple choice and long answer questions. Part A contains 15 1-mark questions on Python concepts like strings, lists, functions, file handling etc. Part B has 10 2-mark questions involving Python programs and network concepts. Part C contains 5 3-mark questions requiring longer answers around Python programs and algorithms. Part D has 5 4-mark questions involving plotting graphs, network design, expressions and data structures.

Uploaded by

ekta shroff
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Max. Marks: 70 Class XII SA-1 Computer Science (083) Duration: 3 hrs.

Note - All Questions are compulsory.


- Programming Language: Python

Part A: All questions carry 1 mark. 15x1=15

(1) Following set of commands are executed in shell, what will be the output?
>>>str="hello"
>>>str[:2]
(2) What is the output of the following?
x = "abcdef"
while i in x:
print(i, end=" ")
(3) What is the output when following code is executed?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]

(4) Process of removing errors is called _______? a) Error Free b) Debugging c) Syntax Error d) Exception

(5) Command to add 5 to the third position in list1? a) list1.insert(3, 5) b) list1.insert(2, 5) c) list1.add(3, 5) d) list1.append(3, 5)

(6) Which are the advantages of functions in python?

(7) Code to open a file c:\scores.txt for reading? a) infile = open(“c:\scores.txt”, “r”) b) infile = open(“c:\\scores.txt”, “r”)
c) infile = open(file = “c:\scores.txt”, “r”) d) infile = open(file = “c:\\scores.txt”, “r”)

(8) The readlines( ) method returns ..? a) str b) a list of lines c) a list of single characters d) a list of integers

(9) What is the output of the code shown below? a) „Sanfoundry\n‟ b) „Sanfoundry‟ c) „Sanfoundry10‟ d) Error
import sys
sys.stdin.readline()
Sanfoundry
(10) Which of the following is equivalent to random.randint(3, 6)? a) random.choice([3, 6]) b) random.randrange(3, 6)
c) 3 + random.randrange(3) d) 3 + random.randrange(4)
(11) Observe the following code and answer the questions that follow:
File = open("Mydata","a")
_____________________ #Blank 1
File.close()
(a) What type of file is Mydata (Text/Binary)?
(b) Fill in Blank 1 with a statement to write “ABC” in the file “Mydata”.
(12) Write any one advantage and one disadvantage of Coaxial cable

(13) The following is a 32-bit binary number usually represented as 4 decimal values, each representing 8 bits, in the range 0 to
255 (known as octets) separated by decimal points e.g. 140.179.220.200 . What is it?

(14) Write the difference between GET and POST method

(15) Name the Python Library modules which need to be imported to invoke the following functions: (a) floor() (b) randn()
Part B: All questions carry 2 marks. 10x2=20
(16) Carefully observe the code and give the output.
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")

(17) What is the output of the below program?


x = 50
def func(x):
print('x is', x)
x=2
print('Changed local x to', x)
func(x)
print('x is now', x)

(18) What is the output of the below program?


def func(a, b=5, c=10):
print('a is', a, 'and b is', b, 'and c is', c)
func(3, 7)
func(25, c = 24)
func(c = 50, a = 100)

(19) What is the value of the postfix expression: 6324+–*

(20) A normal queue is implemented using an array of size MAX_SIZE. Write it‟s Overflow and Underflow conditions.

(21) Differentiate between mutable and immutable objects in Python language with example.

(22) Expand the following: (a) VoIP (b) SMTP (c) CSMA (d) TCP/IP

(23) Write the specific purpose of functions used in plotting: (a) plot() (b) legend()

(24) What is the output of the following piece of code?


def test(i , j):
if(i==0):
return j
else:
return test(i-1,i+j)
print(test(4,7))

(25) Name the network tools used in the given situations:


(a) To troubleshoot internet connection problems (b) To see the IP address associated with a domain name
(c) To look up registration record associated with a domain name (d) To test the speed of internet connection
Part C: All questions carry 3 marks. 5x3=15
(26) Find the output of the following Python program:
def makenew(mystr):
newstr = ""
count = 0
for i in mystr:
if count%2 != 0:
newstr = newstr + str(count)
else:
if i.islower():
newstr = newstr + i.upper()
else:
newstr = newstr + i
count += 1
newstr = newstr + mystr[:1]
print("The new string is:", newstr)
makenew("sTUdeNT")
(27) Write a program in python to count number of words stored in a text file

(28) Write a function to print the factorial of number using recursion.

(29) Write the output of the following statements:


(a) string1='Computer Science'
print(string1.islower())
(b) import math as m
print(m.ceil(m.trunc(15.890)))
(c) string1='Tonight'
print(string1.rstrip('ghti'))
(30) What does Big-O notation indicate? Give the meaning of O(1), O(N), O(log N).

Part D: All questions carry 4 marks. 5x4=20


(31) Write a python program to plot the algebraic equation: 10x + 14
(32) Riana Medicos Centre has set up its new centre in Dubai. It has four buildings as shown in the diagram given below:
Distances between various buildings:

As a network expert, provide the best possible answer for the following queries:
(a) Suggest the type of network established between the buildings.
(b) Suggest the most suitable place (i.e., building) to house the server of this organization.
(c) Suggest the placement of the following devices with justification: (a) Repeater (b) Hub/Switch
(d) Suggest a system (hardware/software) to prevent unauthorized access to or from the network.
(33) Evaluate the following Postfix expression: 20 , 10 , - , 15 , 3 , / , + , 5 , *

(34) Write Addnew(Member) and Remove(Member) methods/functions in Python to Add a new Member and Remove a
Member from a list of Members, considering them to act as INSERT and DELETE operations of the data structure Queue.

(35) WAP to print Fibonacci Series upto „n‟ no. of terms using Recursion.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy