Unit 1 Python
Unit 1 Python
Unit 1 Python
----------------------------------------------------------------------------------------------------------------
UNIT-1: INTRODUCTION TO PYTHON
INTRODUCTION TO PROGRAMMING
Programming is about writing the instructions which a computer follows to enable it to store
knowledge, process knowledge, and communicate knowledge with the outside world. Stemming
from storing knowledge we can move into data structures and databases.
It is the process of writing code to solve a particular problem or to implement a particular task.
Every time you turn on your smartphone, laptop, tablet, smart TV, or any other electronic
device, you are running code that was planned, developed, and written by developers. This code
creates the final and interactive result that you can see on your screen.
INTRODUCTION TO HARDWARE AND SOFTWARE
The term computer is derived from word ‘compute’ which means to calculate.
Computer System
A computer system consists of two major components, namely, hardware and software.
All physical components that forms computer system are known as computer hardware.
Software is basically collection of different programs that tells computer’s hardware what to
do.
Hardware
It includes all components that we can see and touch i.e. processor, input devices like keyboard,
mouse, output devices like visual display unit (VDU), printer, speaker, connecting wires, casing,
storage devices etc. Block diagram depicting major components of computer is shown below:
Computer hardware consists of different functional units: input unit, central processing unit
(CPU) which consists arithmetic logic unit (ALU) and control unit (CU), memory unit and
output unit.
Computer accepts digital data from user with the help of input devices like mouse, keyboard,
microphone etc. Received data from user is either stored in the memory for later use or
immediately processed by the arithmetic and logic unit to carry out the desired operations. After
processing, processed output known as information is either stored in memory for later use or
sent to user with the help of output devices like monitor, printer, speaker etc. All the above
mentioned activities are controlled and coordinated by the control unit.
Set of instructions that tells the computer hardware what to do is known as computer program.
This program or collection of such programs is known as computer software. Concept of
software is illustrated in following figure:
Software guides and tells computer hardware how to accomplish a task. Computer software can
be categorized into two broad categories as system software and application software
Introduction to Software
Computer software can be categorized into two broad categories as system software and
application software as shown in figure below:
Categories of Software
System software are set of programs which are used to control computer activity and computer
hardware. System software also provides platform for application software. Application
software are those programs which are designed to perform specific task and application
software requires system software for their existence. Relationship among hardware, different
software and user is shown in following figure.
:
Hardware Figure Software and User Relation
System Software
1. Operating System:
1. Process Management
2. Memory Management
3. File Management
4. Device Management
5. Security Management
6. Creating User Interface
2. Device Drivers:
Device drivers are set of computer program that controls the operation and functionality
of different devices. Computer system is generally associated with different devices such
as keyboard, mouse, monitor, printer. Functioning of these device is controlled by device
drivers. Each device in the computer system has a device driver associated with it for
proper functioning.
3. Language Translators:
4. Utility Software:
Like hardware, software in computer also needs maintenance. Utility software are
programs that are used to maintain, support, enhance and secure existing program.
Example of utility software includes back up software, antivirus, data recovery software,
disk management etc.
Application Software
These are set of computer programs which are designed to perform specific task. Application
software needs system software for its existence. User comes in contact with application
software to accomplish certain task and system software performs most of the tasks required for
application software in background.
1. Word Processors:
These are used for creating documents such as letters, reports, articles etc. in required
format. Example includes Microsoft Word, Word Perfect etc.
2. Spreadsheets:
These are used for storing records, simple graphical tools, accounting tools, simple
calculations and numerical operations on data. Spreadsheets consists rectangular grids
which contains different cells. Example includes Microsoft Excel, Google Spreadsheets
etc.
These applications are used for manipulation like rotation, cropping, zooming, changing
appearance, adjusting contrast etc. on images. Example includes Adobe Photoshop,
Adobe Illustrator, Picasa, Microsoft Paint etc.
These are used for storing, extraction and manipulation of data. Example includes
Microsoft Access, Oracle, MySQL etc.
5. Web Browsers:
These are used for accessing world wide web (www). Example includes Google
Chrome, Firefox, Microsoft Edge, Torch etc.
List out major differences between system software and application software
Major differences between system software and application software are pointed below:
System S/W: Set of computer programs that are designed to control computer hardware and to
provide service.
Application S/W: Computer program that is designed to perform specific task.
System S/W: System software manages computer resources and provides platform for the
execution of application software.
Application S/W: Application software manages their specific tasks to suit their needs.
Computer understands only machine language that uses 0s and 1s. It is the lowest level language
that computer understands. In machine language different instructions are formed by taking
combinations of 0s and 1s. The computer converts all high level languages into machine
language before executing any statements. Machine language is written in binary form that a
computer can execute directly. These are also known as machine code or object code. This
language is not feasible for humans to use because it consists entirely of binary numbers. If the
word length of the machine is 16 bits (two byte) and we have to add two numbers (say 2 and 4)
then we have to remember binary number that is used for addition (say 0100000011001100).
This language is fastest in terms of execution in the sense that it does not need to be translated.
1. Translation Free : Machine language is the only language that computer understands.
Program written in languages other than machine language must be translated to
machine language. However, the program written in machine language can be directly
executed without any translation.
2. High Speed : Since program written in machine language need not to be translated
and hence conversion time is saved which enables execution of machine language
program extremely fast.
A translator takes a program written in source language as input and converts it into a program
in target language as output.
A program written in high-level language is called as source code. To convert the source code
into machine code, translators are needed.
A translator takes a program written in source language as input and converts it into a program
in target language as output.
Interpreter
It directly executes the operations specified in the source program when the input is
given by the user.
UNIT-1
INTRODUCTION TO PYTHON