11 Usp Computer Science 05 PDF
11 Usp Computer Science 05 PDF
Class: XI
Marks: 70
Please check that this question paper contains four printed pages.
1.(a)
1
1
1
1
(b)
(c)
1
1
(d)
(e)
1
1
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)
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)
4.(a)
(b)
Value=90
Sum=value+30
Value=New value
Division=Value/100
(e)
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)
2
2
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)
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)
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:
(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)