11th Half-Yearly Exam
11th Half-Yearly Exam
SECTION – A
Multiple- Choice Questions: 12 x 1=12
1. A shortcut key to run python program is:
a) F6 b) F5 c) Ctrl + M d) Ctrl + R
2. Which of the following is a valid variable name?
a) age_entry b) 18_age c) age-entry d) @age
3. To give a tab space while printing the statement, you can use:
a) \t b) /n c) Tab key d) Spacebar
4. The input function returns _____________ value.
a) String b) Complex c) Number d) List
5. According to Boolean laws: A + A’ = ____?
a) 1 b) A c) 0 d) A’
6. Which of the following is not a Python data type?
a) String b) List c) Dictionary d) Decimal
7. Which function is used to determine the data type of an object?
a) datatype () b) type () c) dtype () d) typeofdata ()
8. Which of the following operator has the highest precedence?
a) Addition b) Multiplication c) Relational d) Exponentiation
9. range (8) is equivalent to ________.
a) range (1,8) b) range (0,8) c) range (0,8,2) d) range (1,8,1)
10. which of the following is not a Python legal string operation?
a) ‘abc’+’abc’ b) ‘abc’ * 3 c)’abc’ + 3 d)’abc’. lower ()
11. What is the role of pass statement?
A. It does nothing B. It terminates the if statement
C. It passes the control to next statement after loop D. None of the above
12. Which one of these is floor division?
a) / b) // c) % d) None of the mentioned
Fill in the blanks: 15 x 1=15
13. First index and Negative index in memory to store a string character starts with ____ and ____.
14. The ______________ operator is used to perform concatenation of two or more strings.
15. A _____________ is used as a slicing operator.
16. The ______________ bracket can be used o access characters of the string.
17. ______________ are used to indent the python code.
18. ___________ and ___________ are known as Python Jump statements.
19. The __________ statement skips the current iteration and resumes the loop from the next iteration.
20. ________________ and _______________ are three mutable data types.
21. ____________ Membership operator returns True if a character or substring exists in given string.
22. A ____________ is the smallest element in a Python program.
23. A ____________ is a name given to a memory location used by a computer program to store values.
24. Python interpreter ignores statements that start with either ________or ___________.
25. ____________are the reserved words that express a special meaning to the Python interpreter.
26. The three basic logic operators are __________, _______ and _____________.
27. The *= operator is also known as ____________.
28. In an expression with OR and NOT operators, the NOT operator will be executed first.
31. In the ‘if-else’ construct, you can place two else statements with one if.
32. You can also declare the range () function with a negative value.
33. If you remove both the indices during slicing then it will return whole string from 0 to last index.
34. Built-in function isspace () counts and returns total number of whitespaces present in the string.
35. Built-in function split () and partition () are same and return same output for same input.
SECTION – B
36. Write is the output for the following code: (5 x 2=10)
1) Str1= “Mission 999”
Str2=”999”
print (str1.isdigit(), str2.isdigit())
2)
for i in range (55,50, -2):
print(i)
3) x, y = 20, 60
y, x, y = x, y-10, x+10
print (x, y)
4) p=8.6
q=12
r=15
s=450
print(p+q)
print(p/2)
print(s//r)
print(q%5)
5)
x=1
if x>3:
if x>4:
print (“A”, end=’ ‘)
else:
print (“B”, end=’ ‘)
elif x<2:
if (x! =0):
print (“D”)
37. What is the datatype of variables num_new and num_sum? (2)
num1 = 123
num2 = 1.23
num_new = num1 + num2
num3 = “456”;
num3 = int(num3)
num_sum = num1 + num3
if k%3 = = 0:
print(k)
39. What is Dynamic typing and type casting in python? Explain with an example. (2)
42. Rewrite the following code in Python after removing all syntax error(s). (2)
Underlined each correction done in the code.
Value =30
For VAL in range (0, Value)
If val%4==0:
print VAL*4
Elseif val%5==0:
print (VAL+3)
else
print (VAL + 10):
SECTION - C
43. Draw the Logic Circuit of the following Boolean Expression: ` (3)
(A’.C)’ + (A+ B’)’ . (B.C’)
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
e. to remove from right of a string all string-combinations from a given set of letters
(3)
47. Write a python program to receive the numbers from user through keyboard until user gives 0 (to
end the input process), then the program calculates and display the sum of given odd numbers and
even numbers respectively.
e.g. if the user gives the following sequence of numbers: 7 5 10 14 3 9 11 12
Then the output should be as follows:
The Sum of even numbers in given input sequence = 36
The Sum of odd numbers in given input sequence = 35
48. (3)
a) Which data types of Python handle Numbers?
b) What do you understand by term “immutable”?
c) What are mutable and immutable types in Python? List both of them
SECTION – D
52. Write a Python program to print Fibonacci series of first 20 elements. (5)
Some initial element of Fibonacci series is: [ 0, 1, 1, 2, 3, 5, 8…]