Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CLASS XI CS & IP
SAMPLE PAPER
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 )