Posts

Showing posts from October, 2020

Python Revision Tour - Revision Notes

  CBSE Class 12 Computer Science 1 Python Advanced Programming Revision Notes (Review of Python) Interactive Mode:  Interactive Mode, as the name suggests, allows us to interact with OS. Script Mode:  In script mode, we type Python program in a file and then use interpreter to execute the content of the file. Number:  Number data type stores Numerical Values. Sequence:  A sequence is an ordered collection of items, indexed by positive integers. Arithmetic operators:  +, -, *, /, %, ** and //. Relational operators:  <, <=, >, >=, != or <> and ==. Logical operators:  or, and, and not Assignment Operator:  =, +=, -=, *=, /=, %=, **= and //= Functions in Python:  A function is named sequence of statement(s) that performs a computation. Module:  A module is a file containing Python definitions (i.e. functions) and statements. Standard library of Python is extended as module(s) to a Programmer. String:  In python, c...

Working with Functions - Revision Notes

  CBSE Class 12 Computer Science (Python) Working with Functions Revision Notes Some important points are as follows: A  Function  is a subprogram that acts on data and often returns a value. Functions make program handling easier as only a small part of the program is dealt with at a time, thereby avoiding ambiguity. By default, Python names the segment with top-level statements (main program) as  __main__ . A Function is executed in an  execution frame . The values being passed through a function-call statement are called  arguments  (or  actual parameters  or  actual arguments ) The values received in the function definition/header are called  parameters  (or  formal parameters  or  formal arguments ). Python supports three types of formal arguments: parameters Positional arguments (Required arguments), Default arguments and Keyword (or named) arguments. When the function call statement must match the number a...

Using Python Libraries - Revision Notes

  CBSE Class 12 Computer Science (Python) Using Python Libraries Revision Notes Start here in points A library refers to a collection of mudules that together cater to specific type of needs or applications. A module is a separately saved unit whose functionality can be reused at will. A function is a named block of statements that can be invoked by its name. Python can have three types of functions: built-in functions, functions in modules and user-defined functions. A Python module can contain objects like docstrings, variables, constants, classes, objects, statements, functions. A Python module has the .py extension. The doctrings are useful for documentation purposes. A Python module can be imported in a program using import statement. There are two forms of import statements import <modulename> [as <aliasname>] from <module> import <object> The built-in functions of Python are always available; one needs not import any module for them. The random module...

File Handling - Revision Notes

  CBSE Class 12 Computer Science (Python) File Handling Revision Notes Some Important points for File Handling are: A file in itself is a bunch of bytes stored on some storage devices like hard-disk, thumb-drive etc. The data files can be stored in two ways: Text files Binary files A text file stores information in ASCII or Unicode characters, where each line of text is terminated, (delimited) with a sepcial character known as EOL (End of Line) character. In text files some internal translations take place when this EOL character is read or written. A binary file is just a file that contains information in the same format in which the information is held in memory, i.e., the file content that is returned to you is raw (with no translation or no specific encoding). The open() function is used to open a data file in a program through a file-object (or a file-handle). A file-mode governs the type of operations (e.g., read/ write/ append) possible in the opened file i.e., it refers to ...

Recursion - Revision Notes

  CBSE Class 12 Computer Science (Python) Recursion Revision Notes Some important points are as follows: Recursion  refers to a programming technique in which a function calls itself either directly or indirectly. "OR"  A function is said to be recursive if it calls itself. For example: def A( ):       A( ) Here  the Function A () called itself from its own function body, so it is a recursive function,  it is the example of direct recursion as the function A() called itself. another example: def A():       B() def B():       C() def C():       A() This function is the example of Indirect recursion. A popular algorithm that uses recursion successfully is binary search algorithm. There are two cases in each recursive function, the recursive case and the base case. The base case is the case whose solution is pre-known and is used without computation. The recursive case is more general case o...

Idea of Algorithmic Efficiency - Revision Notes

  CBSE Class 12 Computer Science (Python) Idea of Algorithmic Efficiency Revision Notes Some useful Rules for Algorithm Analysis. To analyze a function analyze each statement in the function. The statement that has the greatest complexity determines the order of the function. Some helpful rules are being given for your reference: Addition Rule  "You can combine sequences of statements by using the addition rule, which states that the running time of a sequence of statements is just the maximum of the running times of each individual statement.  Multiplication Rule  This is used to determine the running time for a loop. "You need to determine the running time for the loop's body and the number of times the loop iterates. Frequently you can just multiply the running time of the body by the number of iterations.” An algorithm is a sufficiently precise method or procedure for accomplishing a specific task, which can be programmed on computer. Complexity refers to the mea...

Data Visualisation using Python - Revision Notes

  CBSE Class 12 Computer Science (Python) Data Visualization using Python Revision Notes Some important Points in Data Visualization are: Data visualization basically refers to the graphical or visual representation of information and data using visual elements like charts, graphs, and maps etc. The  matplotlib  is a Python library that provides many interfaces and functionality for 2D-graphics similar to MATLAB's in various forms. Pyplot is a collection of methods within matplotlib which allow user to construct 2D plots easily and interactively. PyPlot essentially reproduces plotting functions and behavior of MATLAB. In order to use pyplot on your computers for data visualization, you need to first import it in your Python environment by issuing  import  command for  matplotlib.pyplot . NumPy is a Python library that offer many functions for creating and manipulating arrays, which come handy while plotting. You need to import 'numpy' before using...

Data Structures – lists, stacks and Queues - Revision Notes

  CBSE Class 12 Computer Science (Python) Data Structures – lists, stacks and Queues Revision Notes Some important points of Data structure are as follows: A data structure is a normal group of data of different data types which can be processed as a single unit. Simple data structures are normally built from primitive data types. Simple data structure can be combined in various ways to form compound data structure. The compound data structures may be linear (whose elements form a sequence) and non-linear (which are multi-level). A Linear list or an array refers to a named list of a finite number 'n' of similar data elements whereas a structure refers to a named collection of variables of different data types. Stacks are "LIFO" (Last In First Out) lists where insertions and deletions take place only at one end. Queues are "FIFO" (First In First Out) lists where insertions take place at  rear  end and deletions take place at the  front  end. In linear search...

Computer Networks and Devices - Revision Notes

  CBSE Class 12 Computer Science (Python) Computer Networks and Devices Revision Notes Start here in points. A network is a collection of interlinked computers by means of a communication system. The networks facilitate resource sharing, increased reliability, reduced costs, and increased and fast communication. On the basis of geographical spread, networks can be classified into LAN (Local Area Netowrk), and WAN (Wide Area Network). Small computer networks that are confined to a localised area e.g., an office, a building etc., are called LANs. A WAN is a group of computers that are separated by large distance and tied together. It can even be a group of LANs that are spread across several locations and connected together to look like a big LAN. On the basis of component roles, networks can be classified into: a peer-to-peer network and a client-server network. A Client computer (or a client) is a computer or other device on the other device on the network that requests and utilize...

SQL Commands - Revision Notes

  CBSE Class 12 Computer Science (Python) SQL Commands Revision Notes Some important points to remember- The basic elements of MySQL SQL are: literals, datatypes, nulls and comments. Literals are fixed data values. Data types of MySQL SQL include: NUMERIC (INT, TINYINT, SMALLINT, MEDIUMINT, BIGINT, FLOAT(M,D), DOUBLE(M, D) AND DECIMAL(M, D), DATE and TIME (DATE, DATETIME, TIMESTAMP, TIME and YEAR(M) and STRING (CHAR(M), VARCHAR(M), BLOB or TEXT, TINYBLOB or TINYTEXT, MEDIUMBLOB or MEDIUMTEXT and ENUM). Column having no value is said to have NULL value. The SELECT command of SQL lets you make queries on the database. The DISTINCT keyword eliminates redundant data. To perform calculations, the expressions can be written along with SELECT without specifying any table name. A small work table  Dummy  can be used for making simple calculations. The  curdate  pseudo-column returns the current system date. The  WHERE  clause is used to select specif...

Creating a Django based Basic Web Application - Revision Notes

  CBSE Class 12 Computer Science (Python) Creating a Django based Basic Web Application Revision Notes Some important points to remember are as follows: A web framework is a software tool that provides a way to build and run dynamic websites and web-enabled applications. An  HTTP Get Request  refers to a way of retrieving information from the given server using a given URL over web. An  HTTP POST request  is a way to send data to the server, (e.g., data filled in an online form such as student information, file upload, etc.) using HTML forms over web. DJANGO is a Python based free and open source web application framework. Virtualenv  is a useful tool which creates isolated Python environments that take care of interdependencies and let us develop different applications in isolation. Each isolated environment has different set of libraries unlike a common global set of libraries. A Django project refers to an entire application and an  app ...

Interface Python with mySQL - Revision Notes

  CBSE Class 12 Computer Science (Python) Interface Python with mySQL Revision Notes Some important points are as follows: To connect to a database from within a programming application, you need a framework that facilitates communication between two different genres of software (programming application and DBMS). To connect from Python to MYSQL, you need a library called  MySQL connector. You must import  mysql.connector  in the Python program/script before writing code of connectivity. Steps to create a database connectivity Python application are: Step 1.   Start Python:  start Python's editor where you can create your python scripts, i.e; IDE or IDLE. Step 2.   Import the package  required for database programming. Here you need to import mysql.connector package in your python scripts. Step 3. Open a connection: Here we  need to establish a connection to MYSQL database using  connect(). T his requires 4 parameters, the syntax fo...