TN Online TestSamacheer Kalvi practice

12th Computer Science One Mark Questions and Book Back Answers

Class 12 Computer Science starts with problem solving: function specification, data abstraction, scoping rules and algorithmic strategies. It then moves to Python programming, including lists, tuples, sets, dictionaries, classes and objects, followed by database concepts and SQL. The last chapters connect Python to other tools: running C++ programs, reading and writing CSV files, querying SQLite and drawing charts with pyplot.

Chapters

1
Function25 MCQs
2
Data Abstraction25 MCQs
3
Scoping25 MCQs
4
Algorithmic Strategies25 MCQs
5
Python Variables and Operators25 MCQs
6
Control Structures25 MCQs
7
Python Functions25 MCQs
8
Strings and String Manipulation25 MCQs
9
Lists, Tuples, Sets and Dictionary27 MCQs
10
Python Classes and Objects25 MCQs
11
Database Concepts25 MCQs
12
Structured Query Language (SQL)20 MCQs
13
Python and CSV Files25 MCQs
14
Importing C++ Programs in Python25 MCQs
15
Data Manipulation through SQL25 MCQs
16
Data Visualization using Pyplot: Line Chart, Pie Chart and Bar Chart24 MCQs

Previous year question papers

View all →
2026
March 202615 MCQs
2025
March 202515 MCQs
2024
March 202415 MCQs
2023
March 202315 MCQs
2022
May 202215 MCQs
2021
Supplementary 202115 MCQs

About Computer Science

Medium ~20 h study

The Class 12 Computer Science book is really three subjects stitched together. First comes problem solving on paper: what a function does, how data is hidden behind constructors and selectors, how a name is looked up in nested scopes, and how fast an algorithm runs. Then comes Python, where those ideas turn into working code. Finally the book brings in databases and SQL, and shows Python talking to C++ programs, CSV files and SQLite.

The order matters. Unit I does not use any particular language, so terms like pure function, impure function, abstract data type and the LEGB rule have to be learnt as definitions. From Unit II onwards you write Python: tokens, operators, if and elif, while and for loops, functions with different kinds of arguments, and string slicing. Unit III covers lists, tuples, sets, dictionaries and classes. Unit IV is database theory, SQL commands and CSV files. Unit V connects Python to C++ programs and SQLite, and ends with pyplot charts.

In the exam, one-mark questions mostly test exact definitions and the output of short code snippets. Longer answers ask you to write a Python program or an SQL query, or to compare two ideas such as list and tuple, or DBMS and RDBMS. So you need both: clear definitions you can reproduce word for word, and enough practice at the keyboard that you can predict what a few lines of code will print. The book-back questions on this site are arranged chapter by chapter for that practice.

What you'll learn

Before you start

Units in Computer Science

Algorithmic Problem Solving and Scoping Function specification, pure and impure functions, data abstraction with constructors and selectors, the LEGB scope rule, and measuring algorithm efficiency with Big O, Big Omega and Big Theta.
Core Python Basics and Operators Python tokens, variables, arithmetic, relational and logical operators, and blocks marked by indentation. Also shows how to write, save and run programs in interactive mode and script mode.
Control Structures and Functional Programming Sequential statements, if, if..else and if..elif..else branching, and while and for loops. User-defined functions with required, keyword, default and variable-length arguments, and lambda functions.
Advanced Data Structures and OOP Lists, tuples, sets and dictionaries compared by mutability, ordering and indexing. Defining classes, creating objects, the __init__ constructor, the __del__ destructor and private data members.
Relational Databases and SQL Principles How a DBMS and an RDBMS differ, data models, integrity constraints, and SQL commands for defining tables (DDL) and changing the rows in them (DML).
Interoperability and CSV File Integration Reading and writing plain-text CSV files with Python's csv module, including rules for fields that contain commas, quotes or custom delimiters.
Systems Integration with C++ and SQLite Using Python as a scripting language to compile and run C++ programs with g++, and running SQL queries on an SQLite database from inside a Python script.
Data Visualization with pyplot Drawing line charts, bar charts and pie charts with the pyplot module of Matplotlib, adding titles, labels and legends, and reading what the chart shows.

Computer Science — the syllabus in depth

How the Syllabus Is Organised

Problem Solving and Algorithmic Thinking

The first unit is about designing a solution before writing any code. A function specification lists its parameters and what it returns. Parameters are the names in the definition; arguments are the values you pass when you call it. A pure function gives the same result for the same arguments and changes nothing outside itself. An impure function may read or change outside variables, so its result can vary. Data abstraction uses constructors to build an abstract data type and selectors to pull values back out, so the rest of the program never needs to know how the data is stored. The scoping chapter explains the LEGB order: Local, Enclosed, Global, Built-in. The last chapter of the unit compares searching and sorting algorithms using Big O, Big Omega and Big Theta to describe time and space complexity.

Python Programming and Control Flow

Python is where the algorithms become programs. You start with tokens (keywords, identifiers, literals, operators and delimiters), variables and the difference between interactive mode and script mode. Python marks a block by indentation, not by curly braces as in C++, so a misaligned line is a real error. The control structures chapter covers sequential statements, alternative branching with if, if..else and if..elif..else, and iteration with while and for. The functions chapter covers required, keyword, default and variable-length arguments, plus anonymous functions written with lambda. The strings chapter covers slicing, stride, and built-in string functions and formatting.

Data Structures and Object-Oriented Programming

This unit introduces Python's collection types. A list is an ordered, mutable sequence in square brackets. A tuple is an ordered sequence that cannot be changed once created. A set holds unique elements with no fixed order. A dictionary stores key-value pairs, and each key must be unique. The classes and objects chapter shows how a class acts as a template and how an object bundles data with its methods. The constructor __init__ runs automatically when an object is created, and the destructor __del__ runs when the object is deleted. A variable whose name begins with two underscores is private and cannot be accessed directly from outside the class.

Relational Databases and Structured Query Language

The database chapters explain what a DBMS does and why an RDBMS stores data in tables of rows and columns linked by keys. Redundancy, consistency and transactions are compared, and data models such as hierarchical, network, relational and entity-relationship are described. The SQL chapter then puts this into practice. DDL commands such as CREATE, ALTER and DROP define tables. DML commands such as INSERT, UPDATE and DELETE change the data. Constraints like PRIMARY KEY, UNIQUE, NOT NULL and CHECK protect the data, and the WHERE clause with aggregate functions such as COUNT, SUM and AVG pulls out the answers you need.

Connecting Python with Other Tools

Unit IV closes with CSV files, and Unit V uses Python as a glue language. You compile and run a C++ program from a Python script using the g++ compiler from MinGW, with the sys, os and getopt modules handling command-line arguments and system commands. The CSV chapter shows how to read and write comma-separated files with the csv module, including values that contain commas, quotes or line breaks. The SQLite chapter runs SQL queries from Python using connection and cursor objects. The last chapter uses the pyplot module of Matplotlib to draw line charts, bar charts and pie charts.

How to study Computer Science

Work through the book in its own order, because each unit uses the one before it. Learn the Unit I definitions and the LEGB rule first; they come back when you write functions and classes. Then open a Python editor and type out every example in the control structures, functions and strings chapters, changing values to see what happens.

After Python, move to lists, tuples, sets, dictionaries and classes, then to database concepts and SQL. SQL questions reward exact syntax, so write the queries out by hand. Finish with the Unit V chapters by running a script that reads a CSV file, one that queries an SQLite table and one that draws a pyplot chart.

Each week, aim to cover:

Regular practice at the keyboard is what makes code-output questions easy to answer in the exam.

Common mistakes to avoid

Frequently asked questions

What is the difference between a pure and an impure function?

A pure function always returns the same result for the same arguments, because the result depends only on those arguments. It has no side effects and does not change any outside variable. An impure function may give different results for the same arguments, because it reads or changes variables outside its own body. random() is a common example of an impure function.

How do constructors and selectors work in data abstraction?

Constructors and selectors are the two kinds of functions used with an abstract data type. A constructor builds the object by putting the pieces of information together, for example making a rational number from a numerator and a denominator. A selector takes one piece back out of the object, such as the numerator, without the caller needing to know how the object is stored inside.

What is the LEGB rule for variable scope in Python?

LEGB is the order in which Python searches for a name. It first looks in the Local scope of the current function. If the name is not there, it checks the Enclosed scope of any outer function, then the Global scope of the module, and finally the Built-in scope, which holds names such as print and len. The first match found is used.

What is the difference between list and tuple in Python?

The main difference is mutability. A list is written in square brackets and can be changed after it is created: elements can be replaced, added or removed. A tuple is written in parentheses and cannot be changed once created. Because of this, iterating over a tuple is slightly faster than iterating over a list.

What are constructors and destructors in Python classes?

They are special methods that Python calls automatically. The constructor, __init__, runs when an object is created and is normally used to set the object's starting values. The destructor, __del__, runs when the object is about to be destroyed, for example after del is used on it, and can be used for clean-up work.

How is a DBMS different from an RDBMS?

A DBMS is software that stores and manages data using a navigational model, where data is reached through linked records. Normalization is not achieved and links between data are weak. An RDBMS stores all data in tables of rows and columns and connects tables through keys. It supports normalization to reduce redundancy, enforces integrity constraints and supports distributed databases. dBase and FoxPro are DBMS examples; MySQL, Oracle and SQLite are RDBMS examples.

What is the difference between DELETE, TRUNCATE, and DROP in SQL?

DELETE removes the rows that match a WHERE condition, or all rows if there is no condition. The table structure stays, and the space used by those rows is not freed. TRUNCATE removes every row in the table and frees that space, but the empty table remains. DROP removes the table itself, structure and data together, from the database.

How do you read a CSV file into a Python dictionary?

Use the DictReader class from the csv module. DictReader treats the first line of the file as the header and uses its values as keys. Each later row is returned as a dictionary that maps those keys to the values in that row. In older Python versions each row comes back as an OrderedDict.

How can Python run external C++ programs?

Python uses the os module to send commands to the operating system. The script calls os.system with a command such as g++ followed by the source file name and -o with the executable name, which compiles the C++ code using MinGW's g++ compiler. A second os.system call then runs the executable, and its output appears in the command window.

Last updated 15 September 2026

Computer Science guides and answer keys

View all
12th Computer Science Python Output Questions: Traced Line by Line The "what is the output" questions in 12th Computer Science follow a few patterns. Here each one is traced lin... 12th Computer Science Important 1 Mark Questions Chapter Wise What the one-mark questions in 12th Computer Science test, chapter by chapter: programming concepts, Python ru... Samacheer Kalvi 12th Computer Science Book Back Answers: All 16 Chapters Book back MCQ answers for all 16 chapters of Samacheer Kalvi 12th Computer Science, with explanations, plus ho...

More 12th Standard subjects

12th Standard Mathematics Chapter-wise MCQs & book-back questions 12th Standard Physics Chapter-wise MCQs & book-back questions 12th Standard Computer Applications Chapter-wise MCQs & book-back questions 12th Standard Chemistry Chapter-wise MCQs & book-back questions 12th Standard Zoology Chapter-wise MCQs & book-back questions 12th Standard Economics Chapter-wise MCQs & book-back questions 12th Standard Commerce Chapter-wise MCQs & book-back questions 12th Standard History Chapter-wise MCQs & book-back questions 12th Standard Geography Chapter-wise MCQs & book-back questions