Samacheer Kalvi 12th Computer Science Notes Chapter 9 Lists, Tuples, Sets and Dictionary

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 9 Lists, Tuples, Sets and Dictionary Notes

Four collections of data types in python programming language:
Python programming language has four collections of data types such as List, Tuples, Set and Dictionary.

List in Python:

  • A list in Python is known as a “sequence data type” like strings.
  • It is an ordered collection of values enclosed within square brackets [ ].
  • Each value of a list is called as element. It can be of any type such as numbers, characters, strings and even the nested lists as well.
  • Values in a list can be changed

Tuple:

  • Tuple consists of a number of values separated by comma and enclosed within parentheses even defined without parenthesis
  • Values in a tuple cannot be changed.

“Singleton” Tuple:
Creating a Tuple with one element is called “Singleton” tuple.

Set:

  • A set is created by placing all the elements separated by comma within a pair of curly brackets.
  • The set() function can also used to create sets in Python.

Set operations:

  • The python supports the set operations such as
  • Union, Intersection, difference and Symmetric difference.

Union:

  • Union includes all elements from two or more sets.
  • In python, the operator | (pipe line) is used to union of two sets.
  • The function union() is also used to join two sets in python.

Example:
Program to Join (Union) two sets using union operator and union function
set_A={2,4,6,8} set_B={‘A’, ‘B’, ‘C’, ‘D’}
U_set=set_A | set_B
print(U _set)
set_ U=set_ A.union(set_ B)
Output:
{2, 4, 6, 8, ‘A’, ‘D’, ‘C’, ‘B’}
{‘D’, 2, 4, 6, 8, ‘B’,’C’,’A’}

Intersection:

  • Intersection includes the common elements in two sets.
  • The operator & is used to intersect two sets in python.
  • The function intersection() is also used to intersect two sets in python.

Example:
Program to insect two sets using intersection operator and intersection function
set_A={/A/, 2, 4, ‘D’}
set_B={‘A’, ‘B’, ‘C, ‘D’}
print(set_A&set_B)
print( set_A.intersection( set_B)
output:
{‘A’,’D’}
{‘A’, ‘D’}

Difference:

  • Difference includes all elements that are in first set (say set A) but not in the second set (say set B).
  • The minus (-) operator is used to difference set operation in python.
  • The function difference() is also used to difference operation.

Example:
Program to difference of two sets using minus operator and difference function set_A={/A’/ 2,4, ‘D’} setJB={‘A’, ‘B’, ‘C, ‘D’} print(set_A – set B) print(set_A.difference( set_B))
Output:
{2,4}
{2,4}

Symmetric difference:

  • Symmetric difference includes all the elements that are in two sets (say sets A and B) but not the one that are common to two sets.
  • The caret (^) operator is used to symmetric difference set operation in python.
  • The function symmetric_difference( ) is also used to do the same operation.

Example:
Program to symmetric difference of two sets using caret operator and symmetric difference function
set_A={‘A’, 2,4, ‘D’} set_B={/A// ‘B’, ‘C, ‘D’}
print(set_A A set_B)
print( set_A.symmetric_difference(set_B))
Output:
{2,4,’B’,’C’}
{2,4,’B’,’C’}

Dictionary:

  • Dictionary is a mixed collection of elements.
  • Unlike other collection data types such as a list or tuple, the dictionary type stores a key along with its element.
  • The keys in a Python dictionary is separated by a colon (:) while the commas work as a separator for the elements.
  • The key value pairs are enclosed with curly braces {}.

Function :copy ()
Description : Returns a copy of the list Syntax : List.copy()

Function :count ()
Description : Returns the number of similar elements present in the last.
Syntax : List.count(value)

Function index ()
Description : Returns the index value of the first recurring element
Syntax : List, index (element)

Function : reverse ()
Description: Reverses the order of the element in the list.
Syntax : List.reverse()

Function: sort ()
Description : Sorts the element in list Syntax : List.sort(reverse=True | False, key=myFunc)

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 4 Algorithmic Strategies

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 4 Algorithmic Strategies Notes

Algorithm:

  • An algorithm is a finite set of instructions to accomplish a particular task.
  • It is a step-by-step procedure for solving a given problem.

Sorting:
Sorting is the process of arranging information or data in certain order either in ascending or descending .

Searching:
Searching is a process of finding a particular element present in given set of elements.

Some of the searching types are:

  1. Linear Search
  2. Binary Search.

Algorithmic strategy:
The way of defining an algorithm is called Algorithmic strategy.

Algorithmic solution:
An algorithm that yields expected output for a valid input is called an algorithmic solution

Algorithm analysis:
An estimation of the time and space complexities of an algorithm for varying input sizes is called algorithm analysis .

Best Algorithm:
The best algorithm to solve a given problem is one that requires less space in memory and takes less time to execute its instructions to generate output.

Asymptotic notations:
Asymptotic Notations are languages that uses meaningful statements about time and space complexity

Memoization:
Memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.

Linear search:
Linear search also called sequential search is a sequential method for finding a particular value in a list.

Binary search:

  • Binary search is also called half-interval search algorithm.
  • It finds the position of a search element within a sorted array.
  • The binary search algorithm can be done as divide-and-conquer search algorithm and executes in logarithmic time.

Bubble sort:

  • Bubble sort is a simple sorting algorithm.
  • The algorithm starts at the beginning of the list of values stored in an array.
  • It compares each pair of adjacent elements and swaps them if they are in the unsorted order.

Dynamic programming:
Dynamic programming is an algorithmic design method that can be used when the solution to a problem can be viewed as the result of a sequence of decisions.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 10 Python Classes and Objects

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 10 Python Classes and Objects Notes

Class:

  • Classes and Objects are the key features of Object Oriented Programming.
  • A class is a way of binding data members and member function together.
  • Class is the main building block in Python.
  • Class is a template for the object.

Instantiation:
This process of creating object is called as
“Class Instantiation”.

Syntax:
Object_name = class_name()

Constructor in Python:

  • In Python, there is a special function called “init” which act as a Constructor.
  • It must begin and end with double underscore.
  • This function will act as an ordinary function; but only difference is, it is executed automatically when the object is created.
  • This constructor function can be defined with or without arguments.
  • This method is used to initialize the class variables.

General format of _init_ method(Constructor function):
def _init_(self, [args ]):
< statements >

Destructor:

  • Destructor is a special method gets executed automatically when an object exit from the scope.
  • It is just opposite to constructor.
  • In Python, _del_ ( ) method is used as destructor.

Class members:

  • Variables defined inside a class are called as “Class Variable” and Functions defined inside are called as “Methods’:
  • Class variable and methods are together known as members of the class.
  • The class members should be accessed through objects or instance of class.

Defining class members:
Any class member (class variable or method (function)) can be defined and accessed by using object with a dot ( . ) operator.

Syntax:
Object_name .class_member

public and private data members of python class:

  • The variables which are defined inside the class is public by default. These variables can be accessed anywhere in the program using dot operator.
  • A variable prefixed with double underscore becomes private in nature. These variables can be accessed only within the class.

Object:

  • Object is a collection of data and function that act on those data.
  • Class is a template for the object.
  • According to the concept of Object Oriented Programming, objects are also called as instances of a class or class variable.
  • In Python, everything is an object.

Creating Objects:

  • Once a class is created, next we should create an object or instance of that class.
  • The process of creating object is called as “Class Instantiation”.

Syntax:
Object_name = class_name()

Accessing Class Members:
Any class member ie. class variable or method (function) can be accessed by using object with a dot (.) operator.

Syntax:
Object_name. class_member

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 3 Scoping

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 3 Scoping Notes

Scope:

  • Scope refers to the visibility of variables, parameters and functions in one part of a program to another part of the same program.
  • The scope of a variable is that part of the code where it is visible.
  • The LEGB rule is used to decide the order in which the scopes are to be searched for scope resolution

Mapping:

  • The process of binding a variable name with an object is called mapping.
  • = (equal to sign) is used in programming languages to map the variable and object.

Namespaces:
Namespaces are containers for mapping names of variables to objects.

Local scope:
Local scope refers to variables defined in current function.

Global variable:
A variable which is declared outside of all the functions in a program is known as global variable.

Nested function:
A function (method) with in another function is called nested function.

Enclosed Scope:
 A variable which function which contains another function definition with in it, the inner function can also access the variable of the outer function. This scope is called enclosed scope.

Built-in scope:
Built-in scope has all the names that are pre-loaded into program scope when we start the compiler or interpreter.

Module:

  • A module is a part of a program.
  • Programs are composed of one or more independently developed modules.

Modular programming:
The process of subdividing a computer program into separate sub-programs is called Modular programming.

Access control:
Access control is a security technique that regulates who or what can view or use resources in a computing environment. It is a fundamental concept in security that minimizes risk to the object.

Public members:
Public members (generally methods declared in a class) are accessible from outside the class.

Protected members:
Protected members of a class are accessible from within the class and are also available to its sub-classes.

Private members:
Private members of a class are denied access from the outside the class: They can be handled only from within the class.They can be handled only from within the class.

Access Specifiers in Python and C++ and Java:

  • Python prescribes a convention of prefixing the name of the variable/method with single or double underscore to emulate the behaviour of protected and private access specifiers.
  • C++ and Java, control the access to class members by public, private and protected keywords
  • All members in a Python class are public by default whereas by default in C++ and java all members are private.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 11 Database Concepts

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 11 Database Concepts Notes

Data and Information.

  • Data are raw facts stored in a computer
  • Information is formatted data

Database:

  • Database is a repository collection of related data organized in a way that data can be easily accessed, managed and updated.
  • Database can be a software or hardware based, with one sole purpose of storing data.

DBMS:

DBMS is a software that allows us to create, define and manipulate database, allowing users to store, process and analyze data easily.
Example: D base, Foxbase, Foxpro

Data consistency:
Data Consistency means that data values are the same at all instances of a database

Components of DBMS:
The Database Management System can be divided into five major components namely

  1. Hardware
  2. Software
  3. Data
  4. Procedures / Methods
  5. Database Access Languages

1. Hardware:
The computer, hard disk, I/O channels for data, and any other physical component involved in storage of data

2. Software:

  • This main component is a program that controls everything.
  • The DBMS software is capable of understanding the Database Access Languages and interprets into database commands for execution.

3. Data:
It is that resource for which DBMS is designed. DBMS creation is to store and utilize data.

4. Procedures/Methods:
They are general instructions to use a database management system such as installation of DBMS, manage databases to take backups, report generation, etc

5. DataBase Access Languages:
They are the languages used to write commands to access, insert, update and delete data stored in any database. Examples of popular DBMS : Dbase, FoxPro

Normalization:
Normalization is a technique of organizing the data in the database.

Types of DBMS Users:

1. Database Administrators:

  • Database Administrator or DBA is the one who manages the complete database management system.
  • DBA takes care of the security of the DBMS, managing the license keys, managing user accounts and access etc.

2. Application Programmers or Software Developers:
This user group is involved in developing and designing the parts of DBMS.

3. End User:

  • All modern applications, web or mobile, store user data.
  • Applications are programmed in such a way that they collect user data and store the data on DBMS systems running on their server.
  • End users are the one who store, retrieve, update and delete data.

4. Database Designers:
Database Designers are responsible for identifying the data to be stored in the database for choosing appropriate structures to represent and store the data.

Different types of a Data Models:

  1. Hierarchical Model
  2. Relational Model
  3. Network Database Model
  4. Entity Relationship Model
  5. Object Model.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 2 Data Abstraction

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 2 Data Abstraction Notes

Data abstraction:
Data abstraction is a powerful concept in computer science that allows programmers to treat code as objects.

Abstraction:

  • Abstraction provides modularity (modularity means splitting a program into many modules). Classes (structures) are the representation for “Abstract Data Types”, (ADT).
  • Abstract Data type (ADT) is a type (or class) for objects whose behavior is defined by a set of value and a set of operations.
  • The definition of ADT only mentions what operations are to be performed but not how these operations will be implemented.
  • The process of providing only the essentials and hiding the details is known as abstraction.

Constructors and Selectors:

  • To facilitate data abstraction, we need to create two types of functions: constructors and selectors.
  • Constructors are functions that build the abstract data type.
  • Selectors are functions that retrieve information from the data type.
  • The basic idea of data abstraction is to structure programs so that they operate on abstract data.
  • A concrete data representation is defined as an independent part of the program.

Two parts of a program:
The two parts of a program are, the part that operates on abstract data and the part that defines a concrete representation.

Concrete data type Vs Abstract data type :

  • A concrete data type is a data type whose representation is known
  • In abstract data type the representation of a data type is unknown

Tuple & List:
To enable us to implement the concrete level of our data abstraction, some languages like Python provides a compound structure called Pair which is made up of list or Tuple.

List:

  • List is constructed by placing expressions within square brackets separated by commas.
  • Example: List := [10,20]

Tuple:

  • A tuple is a comma-separated sequence of values surrounded with parentheses.
  • Example: colour= (‘red’, ‘blue’, ‘Green’)

Difference between List & Tuple :
In a list, elements can be changed.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 12 Structured Query Language (SQL)

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 12 Structured Query Language (SQL) Notes

Structured Query Language (SQL):

  • The Structured Query Language (SQL) is a standard programming language to access and manipulate databases.
  • SQL allows the user to create, retrieve, alter, and transfer information among databases.
  • It is a language designed for managing and accessing data in a Relational Data Base Management System (RDBMS).

Relational Data Base Management System (RDBMS):

  • RDBMS is a type of DBMS with a row- based table structure that connects related data elements and includes functions related to Create, Read, Update and Delete operations, collectively known as CRUD.
  • Oracle, MySQL, MS SQL Server, IBM DB2 and Microsoft Access are RDBMS packages.

Different categories of SQL commands:

  • DDL – Data Definition Language
  • DML – Data Manipulation Language
  • DCL – Data Control Language
  • TCL – Transaction Control Language
  • DQL – Data Query Language

Data types used in SQL:

  • char (Character)
  • varchar
  • dec (Decimal)
  • Numeric
  • int (Integer)
  • Smallint
  • Float .
  • Real
  • double

Predetermined set of commands of SQL:
The SQL provides a predetermined set of commands like Keywords, Commands, Clauses and Arguments to work on databases.

Keywords:

  • They have a special meaning in SQL.
  • They are understood as instructions .

Commands :
They are instructions given by the user to the database also known as statements

Clauses:
They begin with a keyword and consist of keyword and argument

Arguments:
They are the values given to make the clause complete.

Data Definition Language:

  • The Data Definition Language (DDL) consist of SQL statements used to define the database structure or schema.
  • It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in databases.
  • The DDL provides a set of definitions to specify the storage structure and access methods used by the database system.

DDL commands:
i) Create ii) Alter iii) Drop iv) Truncate

  • Create : To create tables in the database.
  • Alter : The ALTER command is used
    to alter the table structure like adding a column, renaming the existing column, change the data type of any column or size of the column or delete the column from the table.
  • Drop : Delete tables from database.
  • Truncate : Remove all records from a table, also release the space occupied by those records.

Data Manipulation Language:
Data Manipulation Language (DML) is a computer programming language used for adding (inserting), removing (deleting), and modifying (updating) data in a database.

Basic types of DML:

Procedural DML
Requires a user to specify what data is needed and how to get it.

Non-Procedural DML
Requires a user to specify what data is needed without specifying how to get it.

DML commands:

  • Insert: Inserts data into a table
  • Update : Updates the existing data within a table.
  • Delete : Deletes all records from a table, but not the space occupied by them.

Data Control Language (DCL):
Data Control Language (DCL) is a programming language used to control the access of data stored in a database.

DCL commands:

  • Grant Grants permission to one or more users to perform specific tasks
  • Revoke: Withdraws the access permission given by the GRANT statement.

Transactional Control Language (TCL):

  • Transactional Control Language (TCL) commands are used to manage transactions in the database.
  • These are used to manage the changes made to the data in a table by DML statements.

TCL commands:
Commit: Saves any transaction into the database permanently.

  • Roll back: Restores the database to last commit state.
  • Save point: Temporarily save a transaction so that you can rollback.

Data Query Language (DQL):

  • The Data Query Language consist of commands used to query or retrieve data from a database.
  • One such SQL command in Data Query Language is “Select ” which is used to display the records from the table.

WAMP:
WAMP stands for “Windows, Apache, MySQL and PHP” It is often used for web development and internal testing, but may be also used to serve live websites.

Constraint:
Constraint is a condition,applicable on a field or set of fields or set of fields.

The different types of constraints are:

  1. Unique Constraint
  2. Primary Key Constraint
  3. Default Constraint
  4. Check Constraint
  5. Table Constraint

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 1 Function

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 1 Function Notes

Expression of Algorithm:
Algorithms are expressed using statements of a programming language

Subroutine:
Subroutines are small sections of code that are used to perform a particular task that can be used repeatedly.

Function:

  • A function is a unit of code that is often defined within a greater code structure.
  • A function contains a set of code that works on many kinds of inputs and produces a concrete output.

Definition:
Definitions are distinct syntactic blocks.

Parameters:
Parameters are the variables in a function definition.

Argument:
Arguments are the values which are passed

Object:
An object is an instance created from the class.

Interface:

  • An interface is a set of action that an object can do.
  • Interface just defines what an object can do, but won’t actually do it.

Implementation:
Implementation carries out the instructions defined in the interface.

Pure functions:
Pure functions are functions which will give exact result when the same arguments are passed.

Impure function:
The functions which cause side effects to the arguments passed are called Impure function.

Recursive function:
A function definition which calls itself is called recursive function.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 11th Economics Notes Chapter 7 Indian Economy

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 7 Indian Economy Notes

→ “India will be a global player in the digital economy”. – Sunder Pichai, CEO Google

→ Meaning of Growth and Development: A country’s economic growth is usually measured by National Income, indicated by Gross Domestic Product (GDP).

→ Demographic trends in India: Scientific study of the characteristics of population is known as Demography.

→ Density of population refers to the average number of persons residing per square kilometer.

→ Literacy ratio refers to the number of literates as a percentage of the total population.

→ Coal and Lignite: India ranks third in the world after China and USA in coal production.

→ Economic infrastructure is the support system which helps in facilitating production and distribution.

→ Education in India: Imparting education on an organized basis dates back to the days of ‘Gurukul’ in India.

→ Education in India until 1976 was the responsibility of the State governments.

→ Health in India is a state government responsibility.

→ Thiruvalluvar: The economic ideas of Thiruvalluvar are found in his immortal work, Thirukkural, a book of ethics.

→ Mahatma Gandhi: Gandhian Economics is based on ethical foundations.

→ Jawaharlal Nehru, one of the chief builders of Modem India, was the first Prime Minister of Independent India and he was there in that post till his death in 1964.

→ B R Ambedkar (1891-1956) was a versatile personality.

→ Joseph Chelladurai Kumarappa was bom on 4 January 1892 in Tanjavur, Tamil Nadu. A pioneer of rural economic development theories, Kumarappa is credited for developing economic theories based on Gandhism – a school of economic thought he coined “Gandhian Economics”.

→ Economic Growth: Transformation of an economy from a state of under
development to a state of development which is measured by Gross Domestic Product (GDP).

→ Economic Development: An improvement in citizens quality of life and well being of a country which is measured by per capita income along with several other development indicators.

→ Gross Domestic Product: Total monetary value of the goods and services produced by that country over a specific period of time, normally a year.

→ Per Capita Income: Average national income per head of population. It is obtained by dividing the National Income by population size.

→ Natural Resources: Goods and services provided by the nature. In other words, any stock or reserve that can be drawn from nature.

→ Renewable Resources: Resources that can be regenerated in a given span of time.

→ Non-Renewable Resources: Resources that are exhaustive and cannot be regenerated.

→ Deforestation: Clearing of forests, trees and thereby forest land is converted to
a non-forest use.

→ Energy Crisis: Situation in which energy resources are less than the demand
and there is shortage of energy.

→ Doctrine of Trusteeship: Doners who act as the trustees of their property or business.

Samacheer Kalvi 11th Economics Notes

Samacheer Kalvi 11th Economics Notes Chapter 6 Distribution Analysis

Tamilnadu Samacheer Kalvi 11th Economics Notes Chapter 6 Distribution Analysis Notes

→ Distribution Analysis: “Distribution accounts for the sharing of wealth produced by a community among the agents or owners of the factors which have been active in its production” – Chapman

→ Meaning of Distribution: Distribution means division of income among the four factors of production in terms of rent to landlords, wage to labourer, interest to capital and profit to entrepreneurs.

→ Functional Distribution: Functional Distribution means the distribution of income among the four factors of production namely land, labour, capital and organization for their services in production process.

→ Assumptions: “Rent is that portion of the produce of the earth which is paid to the landlord for the use of the original and indestructible powers of the soil”. – David Ricardo

→ Quasi-Rent: “Quasi-Rent is the income derived from machines and other appliances made by man”, – Alfred Marshall,

→ The Modern Theory of Rent / Demand & Supply Theory of Rent: “The essence of the conception of rent is the conception of surplus earned by a particular part of a factor of production over and above the minimum earnings that is necessary to induce it to do work” – Joan Robinson

→ Meaning: “A sum of money paid under contract by an employer to a worker for the services rendered”. -Benham

→ Wage fund Theory of Wages: According to Mill “every employer will keep a given amount of capital for payment to the workers”. It is a known as “Wage Fund

→ Meaning: “Interest is the price paid for the use of capital in any market” – Alfred Marshall.

→ Keynes’ Liquidity Preference Theory of Interest or the Monetary Theory of Interest: Keynes propounded the Liquidity Preference Theory of Interest in his famous book, “The General Theory of Employment, Interest and Money” in 1936.

→ Meaning of Liquidity Preference: Liquidity preference means the preference of the people to hold wealth in the form of liquid cash rather than in other non-liquid assets like bonds, securities, bills of exchange, land, building, gold etc.

→ Determination of Rate of Interest: According to Keynes, the rate of interest is determined by the demand for money and the supply of money.

→ Concepts of profit: Gross Profit is the surplus which accrues to a firm when it subtracts its Total Expenditure from its Total Revenue.

→ Risk Bearing Theory of Profit: Risk bearing theory of profit was propounded by the American economist F.B.Hawley in 1907.

→ Uncertainty Bearing Theory of Profit: Uncertainty theory was propounded by the American economist Frank H.Knight.

→ Distribution: Distribution of wealth among agents or the owners of the factors of production.

→ Rent: is reward for the use of land.

→ Wages: are the reward for labour.

→ Interest: is the price paid for the use of capital.

→ Profit: is the reward for organization or entrepreneurship.

→ Quasi-Rent: is the surplus earned by man-made appliances and instruments
of production in the short-period.

→ Transfer earnings: Transfer earnings refer to minimum payment payable to a factor to retain it in its present use. „

→ Money wage: Money wage is the remuneration received by a labourer in terms of money.

→ Real wage: Real wage is the purchasing power of the money wages in terms of goods and services.

→ Loanable fund: Loanable fund is that part of capital meant for loan.

→ Innovation: Invention put into commercial practice.

Samacheer Kalvi 11th Economics Notes