Assessment - Ch 4-5-6
Assessment - Ch 4-5-6
Section I
Attempt any 10 questions from questions 1 to 12
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’
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
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% .