Samacheer Kalvi 12th Chemistry Notes

Tamilnadu Samacheer Kalvi 12th Chemistry Notes

Chemistry NEET MCQ

Samacheer Kalvi 12th Computer Science Notes Chapter 6 Control Structures

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 6 Control Structures Notes

Control structure:
A program statement that causes a jump of control from one part of the program to another is called control structure or control statement.

Control Structures in Python:
There are three important control structures namely

  • Sequential
  • Alternative or Branching
  • Iterative or Looping

Sequential Statement:
A sequential statement is composed of a sequence of statements which are executed one after another. A code to print your name, address and phone number is an example of sequential statement.

Alternative or branching statements in Python:
The types of alternative or branching statements provided by Python are:

  • Simple if statement
  • if..else statement
  • if..elif statement

i) Simple if statement
Simple if is the simplest of all decision making statements. Condition should be in the form of relational or logical expression.

Syntax:
if:<condition>:
statements-block1

(ii) if..else statement
The if ..else statement provides control to check the true block as well as the false block. Following is the syntax of ‘if..else’ statement.

Syntax:
if:<condition>:
statements-block 1
else:
statements-block 2

iii) if..else statement
The if ..else statement provides control to check the true block as well as the false block. Following is the syntax of ‘if..else’ statement.

Syntax:
if:<condition>:
statements-block 1
else:
statements-block 2

Iteration or Looping constructs :

  • Iteration or loop are used in situation when the user need to execute a block of code several of times or till the condition is satisfied.
  • A loop statement allows to execute a statement or group of statements multiple times.

Looping constructs in Python:
Python provides two types of looping constructs:

  • while loop
  • for loop
    1. While loop:
    Syntax:
    while< condition > :
    statements block 1
    [else:
    statements block 2]

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 7 Python Functions

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 7 Python Functions Notes

Function:
A named blocks of code that are designed to do one specific job is called
as Function.

Block in python:
A block is one or more lines of code, grouped together so that they are treated as one big sequence of statements while execution.

Main advantages of function:

  • It avoids repetition and makes a high degree of code reusing.
  • It provides better modularity for your application.

Recursive Function:
A Function which calls itself is called as Recursive Function.

Different types of function:

  1. User-defined functions
  2. Built in functions
  3. Lambda functions
  4. Recursive functions

1. User defined function:
Functions defined by the users themselves are called User defined functions.

Syntax:
def<function_name ([parameter 1, parameter 2 ]) > :
< Block of statement >
return < expression / None>

Example:
def welcome():
print(“Welcome to Python”)
return

2. Built-in functions:
Functions which are using Python libraries are called Built-in function.

Example:
print ()

3. Lambda function:

  • Lambda function is mostly used for creating small and one-time anonymous function.
  • Lambda functions are mainly used in combination with the functions like filterQ, map() and reduceQ.

Syntax of Lambda function (Anonymous Functions):
lambda [argument(s)]: expression

4. Recursive function:

  • A recursive function calls itself. Imagine a process would iterate indefinitely if not stopped by some condition! Such a process is known as infinite iteration.
  • The condition that is applied in any recursive function is known as a base condition.
  • A base condition is must in every recursive function otherwise it will continue to execute like an infinite loop.

Scope of variable:

  • Scope of variable refers to the part of the program, where it is accessible,
  • The scope holds the current set of variables and their values.
  • The two types of scopes are – local scope and global scope.

Local Scope:
A variable declared inside the function’s body or in the local scope is known as local variable.

Global scope:

  • A variable, with global scope can be used anywhere in the program.
  • It can be created by defining a variable outside the scope of any function or block.

Parameters and arguments:

  • Parameters are the variables used in the function definition.
  • Arguments are the values we pass to the function parameters.

Arguments Types:

  • Arguments are used to call a function.
  • There are primarily four types of functions namely :
    1. Required arguments
    2. Keyword arguments,
    3. Default arguments S Variable-length arguments

Required Arguments:

  • “Required Arguments” are the arguments passed to a function in correct positional order.
  • The number of arguments in the function call should match exactly with the function definition.
  • Atleast one parameter to prevent syntax errors to get the required output.

Keyword Arguments:

  • Keyword arguments will invoke the function after the parameters are recognized by their parameter names.
  • The value of the keyword argument is matched with the parameter name and so, one can also put arguments in improper order (not in order).

Default Arguments:
In Python the default argument is an argument that takes a default value if no value is provided in the function call.

Variable-Length Arguments:

  • In some instances it is needed to pass more arguments that have already been specified.
  • These arguments are not specified in the function’s definition and an asterisk (*) is used to define such arguments.
  • These types of arguments are called Variable-Length arguments.

Composition in functions:

  • The value returned by a function may be used as an argument for another function in a nested manner is called

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 5 Python -Variables and Operators

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 5 Python -Variables and Operators Notes

Key features of Python:

  • It is a general purpose programming language which can be, used for both scientific and non-scientific programming.
  • It is a platform independent programming language.
  • The programs written in Python are easily readable and understandable.

Python Coding:

  • In Python, programs can be written in two ways namely Interactive mode and Script mode.
  • The Interactive mode allows us to write codes in Python command prompt ( > > >) whereas in script mode programs can be written and stored as separate file with the extension . py and executed.
  • Script mode is used to create and edit python source file.

Tokens.

  • Python breaks each logical line into a sequence of elementary lexical components known as Tokens.
  • The normal token types are
    1. Identifiers
    2. Keywords K
    3. Operators K
    4. Delimiters
    5. Literals

Operators used in Python :

  • Arithmetic operators
  • Relational or Comparative operator
  • Logical operators
  • Assignment operators
  • Conditional operator

Input-output functions:

  • The input () function helps to enter data at run time by the user .
  • The output function print () is used to display the result of the program on the screen after execution.

Comment statement:
# are considered as comments and ignored by the Python interpreter.

Samacheer Kalvi 12th Computer Science Notes

Samacheer Kalvi 12th Computer Science Notes Chapter 8 Strings and String Manipulations

Tamilnadu Samacheer Kalvi 12th Computer Science Notes Chapter 8 Strings and String Manipulations Notes

String:

  • String is a data type in python, which is used to handle array of characters.
  • String is a sequence of Unicode characters that may be a combination of letters, numbers, or special symbols enclosed within single, double or even triple quotes.

Slicing:

  • Slice is a substring of a main string.
  • A substring can be taken from the original string by using [ ] operator and index or subscript values.
  • Thus, [ ] is also known as slicing operator.
  • Using slice operator, we have to slice one or more substrings from a main string.

General format of slice operation: str[start:end]

  • Start is the beginning index and end is the last index value of a character in the string.
  • Python takes the end value less than one from the actual index specified.

Stride:

  • Slice is a substring of a main string.
  • Stride is a third argument in slicing operation which refers to the number of characters to move forward after the first character is retrieved from the string.

Function: center ()
center () returns a string with the original string centered to a total of width columns and filled with fillchar in columns that do not have characters.

Function: find ()

  • The find () is used to search the first occurrence of the substring in the given string.
  • It returns the index at which the substring starts.
  • It returns -1 if the substring does not occur the string.

Function: lower ()
lower () returns the exact copy of the string with all the letters in lowercase

Function: islower()
islower () returns True if the string is in lowercase.

Function: upper()
upper () returns the exact copy of the string with all letters in uppercase

Function: isupper()
isupperQ returns True if the string is in uppercase.

Function: title()
title() returns a string in title case.

Function: capitalize ()
capitalize () is used to capitalize the first character of the string.

Function: swapcase ()
swapcase () will change case of every character to its opposite case vice-versa.

Function: format()

  • The format( ) is used with strings is very versatile and powerful function used for formatting strings.
  • The curly braces {}are used as placeholders or replacement fields which get replaced along with format() function.

Function: count()

  • count( ) returns the number of substrings occurs within the given range.
  • Substring may be a single character.

Function: isalnum ()

  • isalnum () returns True if the string contains only letters and digit. It returns False.
  • If the string contains any special character like _,@,#,*,etc.

Function: isalpha()
isalpha() returns True if the string contains only letters Otherwise return False.

Function: isdigit ()
isdigit () returns True if the string contains only numbers. Otherwise it returns False

Samacheer Kalvi 12th Computer Science Notes

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