0% found this document useful (0 votes)
37 views3 pages

Python Basic Assessment _1

Important questions for class 12

Uploaded by

ankitbomber01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
37 views3 pages

Python Basic Assessment _1

Important questions for class 12

Uploaded by

ankitbomber01
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Assessment Question-1

Q1. In Python, the combination of operators and operands is called a/an ___________.
(a Operation (b) Expression (c) Statement (d) Loop

Q2. A variable pointing to a certain type can be made to point to different type is known
as___________.
(a) Static typing (b) Dynamic typing (c) Statement (d) Expression

Q3. Which of the following expressions evaluates to True?

(a) not (False or True) (b) not (False and True)


(c) not True and Not False (d) not True or False

Q4. The below given expression will evaluate to


22//5+2**3**2%5
(a)6 (b) 5 (c) 15 (d) 20
Q5. Identify the output of the following Python statements.
b=1
for a in range(1, 10, 2):
b += a + 2
print(b)
(a) 31 (b) 33 (c) 36 (d) 39
Q6. Select the correct output of the following code :
s="I#N#F#O#R#M#A#T#I#C#S"
L=tuple(s.split("#"))
print(L)
(a) [I#N#F#O#R#M#A#T#I#C#S] (b) [‘I’, ‘N’, ‘F’, ‘O’, ‘R’, ‘M’, ‘A’,’T’, ‘I’, ‘C’, ‘S’]
(c) (‘I’, ‘N’, ‘F’, ‘O’, ‘R’, ‘M’, ‘A’,’T’, ‘I’, ‘C’, ‘S’) (d) ('INFORMATICS')

Q7. What is the output when we execute list(“hello”)?


(a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’] (b) [‘hello’] (c) [‘llo’] (d) [‘olleh’]

Q8. State True or False:


The expression 2**2**3 is evaluated as: (2**2)**3.
Q9. Suppose a tuple Tup is declared as Tup = (12, 15, 63, 80) which of the following is
incorrect?
(a) print(Tup[1]) (b) Tup[2] = 90 (c) print(min(Tup)) (d) print(len(Tup))

Q10. What will be the output for the following Python statement?
T=(10,20,[30,40,50],60,70)
T[2][2]=100
print(T)
(a) (10,20,100,60,70) (b) (10,20,[30,40,100],60,70)
(c) (10,20,[30,40,50],60,70) (d) None of these
Q11. Which of the following is an unordered collection of elements
(a) List (b) Tuple (c) Dictionary (d) String

Q12. Which statement is correct for dictionary?


(a) A dictionary is a ordered set of key: value pair
(b) each of the keys within a dictionary must be unique
(c) each of the values in the dictionary must be unique
(d) values in the dictionary are immutable
Q13. Predict the output of the following:
D1={'A':5,'B':5,'C':9,'D':10}
D2={'B':15,'E':10}
D1.update(D2)
print(D1)
(a) {'A':5,'B':5,'C':9,'D':10,’E’:10} (b) {'A':5,'B':15,'C':9,'D':10,’E’:10}
(c) {'A':5,'C':9,'D':10} (d) {'B':7,'D':10,'A':5,'C':9}
Q14. Predict the output of the following:
L=[10,20]
L1=[30,40]
L2=[50,60]
L.append(L1)
L.extend(L2)
print(L)
(a) [10,20,30,40,50,60] (b) [10,20,[30,40],50,60]
(c) [ 10,20,30,40,[50,60]] (d) [ 10,20,[30,40],[50,60]]
Q15. Identify the output of the following code snippet:
text = "PYTHONPROGRAM"
text=text. replace ('PY','#')
print (text)
(a) #THONPROGRAM (b) ##THON#ROGRAM
(c) #THON#ROGRAM (d) #YTHON#ROGRAM

Q16. What is the output of the following Python code?


w='Extramarks'
print(w.split("a"))
(a) ‘Extra’, ‘ma’, ‘rks’ (b) ‘Extr', 'm', 'rks' (c) ['Extr', 'm', 'rks'] (d) ['Extra', 'ma', 'rks']

Q17. Predict the output of the following Python statements:


>>>import statistics as s
>>>s.median ([10, 20, 10, 30, 20, 30])
(a) 30 (b) 20.0 (c) 20 (d) 18.57
Q18. Which function is used to make the program interactive in python?
(a) print() (b) input() (c) range() (d) float ()
Q19. Which statement skips the rest of the loop statement and forces the next iterations of
the loop to take place in python?
(a) break (b) return (c) continue (d) goto
Q20. Which of the following is an identifier?
(a) float (b) global (c) class (d) sum
Q21. Select the correct output of the code:
p= (90)
print(p**2)

(a) 180 (b) 8100 (c) (90,90) (d) (8100 )

Q22. Identify the correct output(s) of the following code from the given options.
import random
s= “Knowledge”
n=random.randint(3,7)
for i in range(0,n,3):
print(s[i],end=’*’)

(a) K* (b) Ko (c) Kol* (d) Kole

Q23. A________ represents labeled storage locations, whose values can be manipulated
during program execution.
(a) constant (b) variable (c) expression (d) control statement
Q24. The return type of the input() function is
(a) string (b) integer (c) list (d) tuple
Q25. Find the statement that raises an error when the following program is executed:
d= {
“flower”: Rose” ,
“Color” : Pink”,
}
del d
print(d)
( a) Statement 1 (b) Statement 3 (c) Statement 5 (d) Statement 6

You might also like