CBSE Class 12 Computer Science Question 10 of 28

Python Revision Tour — Question 27

Back to all questions
27
Question

Question 26

Below are seven segments of code, each with a part coloured. Indicate the data type of each coloured part by choosing the correct type of data from the following type.

(a) int
(b) float
(c) bool
(d) str
(e) function
(f) list of int
(g) list of str

(i)

if temp < 32 :
    print ("Freezing")

(ii)

L = ['Hiya', 'Zoya', 'Preet']
print(L[1])

(iii)

M = []
for i in range (3) :
    M.append(i)  
    print(M)      

(iv)

L = ['Hiya', 'Zoya', 'Preet']
n = len(L)
if 'Donald' in L[1 : n] :
     print(L)

(v)

if n % 2 == 0 : 
   print("Freezing")

(vi)

L = inputline.split()
while L != ( ) :
    print(L)
    L = L[1 :]

(vii)

L = ['Hiya', 'Zoya', 'Preet']
print(L[0] + L[1])
Answer

(i) bool
(ii) str
(iii) list of int
(iv) int
(v) bool
(vi) list of str
(vii) str


Source: This question is from Python Revision Tour, Computer Science — Class 12, CBSE Board.

Key Concepts Covered

This question tests your understanding of the following concepts from the chapter Python Revision Tour: Question, Seven, Segments, Code, Part, Coloured. These are fundamental topics in Computer Science that students are expected to master as part of the CBSE Class 12 curriculum.

A thorough understanding of these concepts will help you answer similar questions confidently in your CBSE examinations. These topics are frequently tested in both objective and subjective sections of Computer Science papers. We recommend revising the relevant section of your textbook alongside practising these solved examples to build a strong foundation.

How to Approach This Question

Read the question carefully and identify what is being asked. Break down complex questions into smaller parts. Use the terminology and concepts discussed in this chapter. Structure your answer logically — begin with a definition or key statement, then provide supporting details. Review your answer to ensure it addresses all parts of the question completely.

Key Points to Remember

  • Write programs with proper indentation and comments.
  • Trace through your code with sample inputs to verify correctness.
  • Explain the logic behind each step of your solution.
  • Familiarise yourself with common library functions and methods.

Practice more questions from Python Revision Tour — Computer Science, Class 12 CBSE