Anda di halaman 1dari 4

I SEMESTER Sample Papers

Class: XI

Subject: Computer Science with Python

Marks: 70

Please check that this question paper contains four printed pages.
1.(a)

Define clock speed.

How is compiler different from interpreter?


What is the function of memory? What are its measuring units?
Mention two differences between CISC and RISC?
List three devices that are contained inside the computer case.

1
1
1
1

Convert the hexadecimal number to decimal (ABEF)16

(b)
(c)

Convert (1100111)2 to decimal.


Convert(473)8 to binary.

1
1

(d)
(e)

Convert (FACEAB)16 to binary.


Convert (487)10 to binary.

1
1

How keyword differ from identifier?


What will be the output produced by following code?

1
2

Name=Simson
Age=21
print(Name, , you are, Age, now but)
print(You will be,age+1,next year)
Predict the output

(b)
(c)
(d)
(e)
2.(a)

3.(a)
(b)

(c)

a,b,c=10,20,30
p,q,r=c-10,a+3,b-4
print(a,b,c:, a,b,c)
print(p,q,r:,p,q,r)
(d)

Why following identifiers(variable names) are invalid:


i. Employee Number
ii. 34Payscale
iii. $text.ppt
iv. for

What is the difference between interactive mode and script mode in Python?
What are operators? What is their function?

2
2

(c)

Write Python program to print area of circle , area of triangle and area of square
using if statement.

(d)

What is the problem with the following code fragment?

4.(a)
(b)

Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in


Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks

Value=90
Sum=value+30
Value=New value
Division=Value/100
(e)

What is the result of following expression :

i. (a+b)>10and(c+d)<=25
ii. (a>=c) or (c<=b), if a=5,b=12,c=20

5.(a)

(b)
(c)
(d)

6.(a)
(b)
(c)
(d)

(e)
(f)

Using detailed explanation predict the output of the following program:A=6+2/3


B=float(3+5/8)
C=3+float(5/8)
D=3+5.0/8
E=4+5/8.0
F=10%8
print(A,B,C,D,E,F)
How built-in function differs from user-defined function.
What are docstrings? What is their significance.

2
2

Write a program in Python to solve following mathematical expression.


54+ye3y+89

Write down the general form of Nested if statement.


Write down Python program to check whether a given character is an uppercase
or a lowercase character or a digit.
Write a Python script to print Fibonacci series first 20 elements. Some initial
elements of Fibonacci series are: 0 1 1 2 3 5 8 13.
Write a program to print the following using a single loop.(no nested loops)

2
3

6
66
666
6666
66666
666666
6666666
Using suitable Python codes illustrate the difference between local variable and
global variable.
Fill in the two missing blank statements so that the following Sumofnumbers()
displays the sum of the numbers that will be passed as a parameter.
def Sumofnumbers(n):
sum=0
while (n!=0):
-----blank line1----------------------sum+=remainder
Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in
Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks

3
3

2
2

-----blank line2----------------------print(sum)

7.(a)

Consider a function with following header:

def info(object, spacing=20, collapse=4):


Here are some function calls given below. Find out which of these are correct
and which of these are incorrect stating reasons:
a. info(obj2)
b.info(spacing=40,collapse=2)
d.info(obj3,34)
(b)

Consider the following Python program:


N=int(input(enter the number:))
i=1
sum=0
while(i<N):
if(i%2==0):
sum+=i
i=i+1
print(sum)

a. What is the output when the input value is 8?


b. What is the output when the input value is 2?
(c)

Distinguish between break statement and continue statement with reference to


the following codes:-

Code-1
Code-2
print(program for break statement)
print(program for continue
statement)
for t in range(1,10):
for t in range(1,10):
if(t%2==0):
if(t%2==0):
break
continue
else:
else:
print(t)
print(t)

(d)

Following code contains an endless loop. Could you find out why? Suggest a
solution.
Num=40
Result=1
while(Num>0):
Result=Result+Num**2
Num=Num+1
print(Result)
Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in
Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks

8.(a)

Trace the following code and predict output produced by it.

1. def switch(x,y):
2.
x,y=y,x
3.
print(inside switch:,x,y)
4.
5. x=5
6. y=10
7. print(x=,x,y=,y)
8. switch(x,y)
9. print(x=,x,y=,y)
(b)

Using detailed explanation predict the output of the following Python program:

def stu_marksheet(science, maths=90,social=89):


total=science+maths+social
average=total/3
return(average)

(c)

print(stu_marksheet(40,100))
print(stu_marksheet(science=100,social=87))
print(stu_marksheet(67))
Rewrite the following program, after correcting error(s), if any. You must
underline the correction(s), if made:
import math
P=input(Enter a number:)
Q=pow(P,2)
print(P;Q)

Material downloaded from http://myCBSEguide.com and http://onlineteachers.co.in


Portal for CBSE Notes, Test Papers, Sample Papers, Tips and Tricks

Anda mungkin juga menyukai