You are on page 1of 1

PAT-I (2021-22)

th
Class : 12 Subject : Computer Science (083) MM : 50
Q.1. Multiple Choice Questions : [15M]
i. How would you write xy in Python as an expression?
(a) x^y (b) x**y (c) x^^y (d) x*y
ii. What is the value of x ? x = int( 13.25+4/2)
(a) 17 (b) 14 (c) 15 (d) 23
iii. The expression8/4/2 will evaluate equivalent to which of the following expressions:
(a) 8/(4/2) (b) (8/4)/2 (c) Both (d) None of these
iv. A token os also called ……….
(a) Lexical Unit (b) Identifier (c) Literals (d) None of these
v. The operator …… tells if an element is present in a sequence or not.
(a) exists (b) in (c) into (d) inside
vi. What data type is the object ? L = 1, 23, ‘Hello’, 1
(a) list (b) Dictionary (c) string (d) tuple
vii. Suppose a Tuple T is declared as T = (10, 12, 43, 39), which of the following is incorrect?
(a) print(T[1]) (b) T[2]=-29 (c) print(max[T]) (d) print(len[T])
viii. What is the output of this code? >>> print(“3” + “4”)
(a) “7” (b) “34” (c) 34 (d) 7
ix. The ……… function returns all the key : value pairs as (key, value) sequences.
(a) key() (b) values() (c) items() (d) None of these
x. To convert an input()’s value in integer type, …………. Function is used.
(a) string() (b) int() (c) float() (d) type()
xi. What is the default return value for a function that does not return any value explicitly?
(a) None (b) int (c) double (d) null
xii. What is the name given to that area of memory, where the system stores the parameters and local variables of
a function call?
(a) a heap (b) storage area (c) a stack (d) an array
xiii. what is the result of this code? Def print_code( x ):
print(2**x)
print_code( 3 )
(a) 8 (b) 16 (c) 6 (d) 4
xiv. By default, Python names the segment with top-level statements (main Program) as ………..
(a) __main__ (b) _name__ (c) function (d) None of these
xv. Function not returning any value is called ………………
(a) void function (b) main function (c) both (d) None of these

Q.2. What is the value of the expression 10 + 3 ** 3 * 2 ? OR 50 // 90 + 85 [2M]


Q.3. What is global variable? [2M]
Q.4. Predict the output: [2M]
x = 40
a, b, c = 2, 3, 4 y=x+1
OR
a, b, c = a*a, b*b, c*c x = 20, y+x
print( a, b, c ) print( x, y )
Q.5. Write a program to print cubes of numbers in the range 15 to 20. [2M]
Q.6. What is nested list? Explain with example. [2M]

Q.7. What is the difference between (30) and (30,)? [3M]


Q.8. Write a program to display table for given number. [3M]
OR
Write a program that multiplies two numbers without using the * operator, using repeated addition.
Q.9. What is the output of the following code? rec = {“”Name” : ”Python”, “Age” : ”20”} [3M]
r = rec.copy()
print(id(r) == id(rec))
Q.10. What are the difference between Mutable and immutable type? [3M]
Q.11. Write a program that reads a line and print its No. of uppercase letters. [3M]

Q.12. Write a program to sort a sequence using insertion sort. [5M]


OR
Write a program that reads a string and checks whether it is a palindrome string or not
Q.13. Write a program to add two numbers using function? [5M]

You might also like