Sei sulla pagina 1di 2

KENDRIYA VIDYALAYA FORTWILLIAM

PERIODIC TEST –I 2018-19

CLASS XI CS & IP

SAMPLE PAPER

1. What is None literal in python? 1


2. Identify the correct identifiers of python: 1
a) Float
b) One.a
c) end
d) type
3. What is dynamic typing feature of python? Explain with a suitable example. 2
4. Write name of two mutable and two immutable data types used in python. 2
5. What would following code fragment result in ? Given x= 3 , y=4 , z=5 2
(a) 1< x and y>4
(b) 0 and z
(c) Z*y**x
(d) Z**x*y
6. Write the corresponding Python expressions for the following mathematical Expressions: 2
a) 2 − 𝑦𝑒 2𝑦 + 4𝑦
b) D= 𝑥 = √(𝑥2 − 𝑥1) 2 + (𝑦2 − 𝑦1)2

7. Evaluate : 4
a. 22.0/7.0
b. 22.0/7.0 - int(22.0/7.0)
c. 1 or None and ‘a’ or ‘b’
d. “Abc”==”abc” and not(2==3 or 3==4)
8. Write a program to convert temperature entered by user in Celsius into Fahrenheit . 2
9. Write a program to display cube of n numbers , where n is entered by user. 3
10. What will be output produced by following program code: 2
(a) x , y= 4, 8
z= x/ y*y
print(z)
(b) for I in [2,4,6]:
for j in [5,10,15]:
if((i*j)%2==0)
print (i):
else :
print(j)
11. WAP to display second largest from n numbers , where numbers are entered by user. 3
12. Rewrite the following code fragments using while loops : 2
for I in range (1 , 16):
if i%3==0:
print(i)
13. Rewrite the following code using for loop: 2
while num>0:
count+=1
sum+=num
num- =2
if count ==10:
print(sum/float(count))
break
14. Write purpose of following functions with example: 3
a. id()
b. type()
c. input()
15. Write python statement for the following: 3
a. To assign value 10 to variables x , y, z in single statement
b. To swap two variables x and y in single statement
c. For loop which starts from 100 and goes upto 201 with 6 steps each time.
16. Use the python range() function to create the following list:[7,3,-1,-5] 1
17. Write a loop which displays the even numbers between n1 and n2 , where n1 and n2 are two
numbers entered by user. 2
18. Write a Python script to print Fibonacci series͛ first 20 elements. Some initial elements o Fibonaci
series are: 3
0 , 1, 1, 2,3,5,8,13,21,----------
19. What will be the output of following Python code? 2

a=12

b=7.4

c=1

a-=b

print (a, b)

a*=2+c

print(a)

b+=a*c

print( b )

20. How can comments be written in python programming language? 1


21. Find out error in the following program code:- 1
Name=”Prajjawal”
Age=32
Print(Name+Age)
22. How is implicit type conversion different from explicit type conversion.Explain with help of an
example. 2
23. Given str1=”Hello” , what will be value of : 1
a. Str1[0] b. str[[-5]
24. If you give str1=”Hello” , why does python report error? 1
Str1[2]=’p’
25. What will be result given by following ? 2
(a) type(6/3)
(b) not b and not (a or c) if a= false ,b=true and c=false

Potrebbero piacerti anche