Computer Science Mock-1
Computer Science Mock-1
Set – 1/1/1
INSTRUCTIONS:
A. Decision-making
B. Array
C. List
D. None of the mentioned above
n=int(input("enter:"))
temp=n
dig=0
rev=0
dig=temp%10
rev=___________________ // Statement 2
temp=________________ // statement 3
if ____________________: // Statement 4
print("it is palindrome")
else:
print("not palindrome")
SECTION B
Q1 (a) What is bit? How bit, byte and nibble are related with each other? (2)
(b) What is application software? Write any two example (2)
(c) Write two features of Windows OS. (2)
(d) What will be output of following code:
A,B,C,D=9.2, 2.0, 4, 21
print(A/4)
print(A//4)
print(B**C)
print(A%C) (2)
Q2 (a) Write a program to input your name, age and interviewer’s name using proper data type. Use
print function to print the details on screen in one line. (2)
(b) Write a program to calculate the volume and surface area of sphere :
● Volume = 4/3 ᴨr3
● Area = 4 * p * r2 (2)
(c) Suppose your brother is working in an MNC as Sr. Programmer. Write a program to print your
brother’s profile using suitable escape characters. (2)
Q3 (a) Write a program to test the divisibility of a number with another number. (2)
(b) Write a program to find the Fibonacci series of numbers . (3)
(c) Write the pseudo code and Python program to print the following pattern: (3)
*******
******
*****
****
***
**
*
(d) Write a program to evaluate the power series. The series looks like,
x2 x3 xn
S=1+x+ + ....+
2! 3! n!
Where 0 < x < 1. (3)
(e) Write a program to find the largest among three numbers. (3)
Q4 (a) Write two different forms of IF statements with example (2)
(b) 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
(c) Explain break, continue and pass statements with example. (3)
(d) for i in '123':
print ("half yearly exam",i,) (3)
Q5 (a) What will be the output of following program? (2)
S1 =" 2019 Edition"
L =len(S1)
S2=""
for a in range(L):
if(S1[a].islower()):
S2=S2+S1[a].upper()
elif(S1[a].isdigit()):
S2=S2+"#"
else:
continue
Page 4 of 5 of (CS XI HY) SET 1
print("New String is", S2)
(b) Identify the types of error in the following code: (2)
(i) If sum=a+b
(ii) p+r=10
(c) What will be the output of the following:
(i) 5<5 or 10 (ii) bool(‘11’) (2)
(d) Why does python report error for the following code?
str(“Hello”)
str[2]=’p’ (2)
(e) When these exceptions occur? Explain. (2)
(i) Syntax error (ii) Logical error