Rising Academy Time: 2 hrs.
Class 11, COMPUTER SCIENCE - Assessment Max. Marks : 40
Section I
Attempt any 10 questions from questions 1 to 12
1. Find the invalid identifier from the following [1]
a) EmpCode b) None c) 7thComp d) My_File
2. Identify the valid arithmetic operator in Python from the following. [1]
a) ? b) < c) ** d) and
3. Which escape sequence is used for tab. [1]
4. default separator character for print( ) function is ___________ [1]
5. Find the output of the following operation: [1]
>>> 9%4
6. Evaluate the following expressions: [1]
6 * 3 + 4**2 // 5 – 8
7. Evaluate the following expressions: [1]
10 > 5 and 7 > 12 or not 18 > 3
8. Write the output of following code : [1]
x , y, z = True , False , False
if x or y and z :
print ("Welcome to the Event")
else:
print ("Try Again ! ")
9. What will be the output of the following Python code? [1]
for i in “Python”:
print( i )
10. Write output of following code: [1]
a , b = 20 , 60
a , b = b-a , a*b
print(a , b)
11. Which data type is used in Python to represent null or absence of value. [1]
12. Following python code is producing error, Explain Why? [1]
S = "Welcome"
S[2] = "@"
print(S)
Section-II
Case study based question has 5 case-based subparts. Attempt all 5 parts.
13. Mr Nayar wants to print all even numbers till the limit inputted by the user. Help him to
complete the following code :
Limit = ________(input("Enter a number: ")) #Line 1
for i in range(__________): #Line 2
if _________________ : #Line 3
print( ____ ) #Line 4
_________________________ #Line 5
i) Name the function that converts input into integer value at Line1. [1]
ii) Write range arguments that iterates from 0 to the Limit at Line2 [1]
iii) Write a condition that checks whether the variable i is divisible by 2 at Line3. [1]
iv) Write command to print the variable i with the next output of print
command to be printed on the same line at Line4. [1]
v) Write a statement to print “Program ends!!” at Line5? [1]
Section-III
14. Give the output of the following python code. [2]
for i in "Rising" :
print(i, sep='-', end="\t")
print(“Over!!”)
15. Find and underline the errors in the following code, rewrite the correct program
underlying the correction done. [2]
i, j=5
i==j+5
if i=j :
print(“i and j are unequal”)
print(“they are not equal”)
else i>j :
print(“i and j are equal”)
16. Give the output of the following python code. [2]
s = input(“Enter your section : “))
if s in ‘aA’ :
print(“Medical”)
elif s in ‘bB’ :
print(“Non-Medical”)
elif s in ‘cCdD’ :
print(“Commerce”)
elif s in ‘eEeF’ :
print(“Humanities”)
else:
print(“Not a valid section”)
print(“*** Rising Academy ***”)
What will be the output if the input done in variable s is :
1) ‘D’ 2) ‘H’
17. Give Output for the below python code: [2]
S = "Welcome to Python"
print(S[ 14 : 5 : -2 ])
print(S[ : : 3 ])
18. WAP that counts and prints digits and spaces in the string inputted by the user. [3]
19. Write a program to check whether the number inputted by a user is divisible [3]
by 5 or not.
OR
Write a program to read a 4 digit number and exchange the first and last digit of that
number. For example if the given number is 4153 then the output should be 3154
Section-IV
20. Write the output of the code when executed: [3]
Text = "
[email protected] l = len("Text")
ntext = ""
for i in range( 0, l):
if Text[i].isupper():
ntext = ntext + Text[i].lower()
elif Text[i].isalpha():
ntext = ntext + Text[i].upper()
else:
ntext = ntext +"*"
print(ntext)
21. Write two points of difference between : (attempt any two) [4]
a) Selection and iteration constructs
b) Relational operators and Logical Operators
c) / and // arithmetic operators
22. A bank accepts fixed deposits for one year or more and the policy it adopts on interest
is as follows: [4]
Years Amount Deposited Interest Rate
<=2 >=2000 and <6000 5%
>=6000 6% .
>2 and <=5 >=2000 and <6000 7%
>=6000 8% .
>5 ---- 10%
- - - - indicates any value of amount entered
Simple Interest = ( Amount_Deposited * Rate * Time ) / 100
Net Amount = Amount_Deposited + Interest
Write a program to input the amount deposited and the number of years, and
calculate the simple interest and net amount in the customer’s account at the end of
the specified time.