Sei sulla pagina 1di 3

KENDRIYA VIDYALAYA SANGATHAN JAMMU REGION

HALF YEARLY EXAMINATION, 2018-19

CLASS :XI
SUBJECT: COMPUTER SCIENCE
Time : 3hours MM:70
Instructions: 1. All questions are compulsory
2.Programming Language : PYTHON
Q1
a) “Python is an interpreted high level language”.What does this mean? 1
b) Write two advantages and disadvantages of Python. 2
c) What is the difference between a keyword and an identifier? Give example. 2
d) Which of the following identifiers are valid? Give reasons , if invalid:
INFO-PR, MYFILE, , while , comp_sc 2
e) Define Decision Tree . Explain with example 3
Q2 :
a) What is the use of comments and indentation in a program? 2
How do we write comments in a program?
b) Define Dynamic Typing in context of a variable with example. 1
c) What is None in Python? 1
d) What will be the output of the following code : 2
a = 3+5/8
b= int(3+5/8)
c = 33//5
d=33%5
print (a,b, c, d)

e) Write the corresponding Python expressions for the following mathematical expressions: 2
(i) √a2 +b2+ c2
(ii) | e2 –x|

f) Draw a flowchart to find the largest of three numbers .. 2

Q3:
a) What are mutable data types ? Explain with example. 2

b) What will be the output produced by the following code fragment :


(i) name = “ Neeru” 2
age= 17
print (name, “Hello”)
print (“You will be” , age +1 , “ next year”)
(ii) i=1 2
while i < 10:
print(i)
i += 2
c) Rewrite the code in Python after removing all syntax error(s). Underline 2
each correction done in the code
TEXT=""GREAT
DAY""
for T in range[0,7]:
print TEXT(T)
print T+TEXT

d) What is the difference between implicit and explicit type conversion?


Explain with code 2
Q4:
a) Define Syntax error. How it is different from semantics error? 2
b) What is Pseudocode ? Give an example. 2
c) Consider the following Python program and give the output
N= int(input(“Enter N:”)) 2
i=1
sum = 0
while i<N
if i%2==0:
sum = sum+i
i= i+1
print(sum)
(i) when the input value is 5
(ii) when the input value is 0

(d) Rewrite the following code fragment using for loop: 2


i=100;
while (i>0):
print (i)
i -=3
e)Explain logical operators with example . 2

Q5:
a) What are the types of Strings supported by Python ? Explain with example. 2
b)Write a program that reads a number and finds its factorial. 3
c): Write programs in Python :
i) To print Fibonacci series. 3
ii)To input a number and test if it is a prime number. 2
Q6:
a) Write the names of list methods to perform the following : 2
(i) Delete a given element from the list.
(ii) Add an element in the end of the list.
b) How tuples differ from list ? Explain with example. 2
c) Write a program in Python :
(i) to sort a list of elements using insertion sort. 3
(ii) To search for an element in a given list of numbers. 3

Q7:
a)What are state transition diagrams? Draw state transition diagram for game of chess. 3
b) Explain the use of following functions in list with example: 4
(i) insert ()
(ii) pop ()
c) Write a program in Python to count the frequency of elements in a list using a dictionary. 3
For example This is a Computer program. Computer programs are related to real world. Developing programs is
an art.
Output : This :1 , is : 2, a:1, Computer : 2 program : 1 are : 1 and so on.

*********************************************************************

Potrebbero piacerti anche