python-unit-i-2
python-unit-i-2
Introduction
In last few year Python has been priority of many software developers. Its
importance as programming point of view is always growing. Python has already introduced
in India by various university. So to develop python program we first know various
terminology related to python.in next some sub point we first introduce some terminologies
related to Hardware & Software part also we can revise some part of computer in unit I then
in next unit we introduce some python basics & some python programming skill.
Now if we discuss about above block diagram there are various part of computer system.
Generally known as components of computer system. In above diagram we can see,
various components of computer system all these components are explain as below.
1.1.2 Computer Components:
1.1.2.1 Input Device:-
Input Unit: An input device is a hardware component used to provide data and
control signals to a computer or other electronic system. Input devices allow users to interact
with the computer, enter information, and command the computer to perform specific tasks.
User Interface: Facilitates interaction between the user and the computer.
Data Entry: Captures user input in various forms (text, audio, visual, etc.).
Control Signals: Sends commands to the computer to execute actions.
1. Keyboard: A peripheral device used to input text and commands through keys.
Keyboards typically have alphanumeric keys, function keys, and control keys.
2. Mouse: A pointing device used to interact with graphical elements on a screen. It
detects two-dimensional motion relative to a surface, translating it into cursor
movement.
3. Touchscreen: A display that also serves as an input device, allowing users to interact
with the computer by touching the screen directly.
4. Scanner: Converts physical documents and images into digital form, allowing the
computer to process and store them.
5. Microphone: Captures audio input for voice commands, recording, or
communication.
6. Webcam: Captures video input for video calls, recording, and streaming.
7. Game Controller: Used primarily for gaming, providing input through buttons,
joysticks, and other controls.
8. Barcode Scanner: Reads barcodes and converts them into digital data that the
computer can process.
9. Digital Camera: Captures and inputs digital photographs and videos.
Input devices convert physical actions (such as typing on a keyboard or clicking a mouse)
into electronic signals that a computer can understand and process. These signals are then
translated into appropriate responses by the computer's software, enabling tasks such as text
entry, navigation, and command execution.
User Interaction: They are essential for user interaction with computers, enabling
tasks ranging from simple text entry to complex data manipulation.
Accessibility: Provide various ways for users to input data, catering to different needs
and preferences.
Productivity: Enhance productivity by allowing efficient and precise control over
computer functions.
1.1.2.2 Output Device:-
1. Monitor: A display screen that presents visual output from the computer. Monitors
can display text, images, videos, and the graphical user interface (GUI) of the
operating system and applications.
2. Printer: Produces physical copies of digital documents and images on paper or other
media. Common types include inkjet, laser, and dot matrix printers.
3. Speakers: Output devices that produce sound, allowing users to hear audio from the
computer, such as music, voice, or sound effects.
4. Headphones: Personal audio output devices that provide sound directly to the user's
ears, often used for private listening.
5. Projector: Projects visual output from the computer onto a larger screen or surface,
commonly used for presentations and large displays.
6. Plotter: A specialized printer used for printing vector graphics, such as engineering
drawings and architectural plans.
7. Braille Display: Converts text into Braille characters, allowing visually impaired
users to read digital text through tactile feedback.
8. LED Indicators: Simple output devices that provide visual feedback using light-
emitting diodes, often used in hardware interfaces to indicate status.
How Output Devices Work:-Output devices receive processed data from the computer
and convert it into a form that can be perceived by humans or used by other devices. For
example, a monitor converts digital signals into images and text, while speakers convert
digital audio signals into sound.
The Central Processing Unit (CPU), often referred to as the "brain" of the computer, is a
critical component responsible for executing instructions and processing data. It performs the
basic arithmetic, logic, control, and input/output operations specified by the instructions in
the program.
1. Clock Speed
o Measured in gigahertz (GHz), it indicates the number of cycles the CPU can
execute per second. Higher clock speeds generally mean faster processing
times.
2. Cores
o Modern CPUs contain multiple cores, each capable of executing instructions
independently. More cores can significantly improve performance for
multitasking and parallel processing.
3. Threads
o Threads are the smallest sequence of programmed instructions that the CPU
can manage independently. CPUs with more threads can handle more tasks
simultaneously, improving efficiency and speed.
4. Cache Memory
o A small-sized type of volatile computer memory that provides high-speed data
access to the CPU and improves processing speed by storing frequently used
instructions and data.
Functions of the CPU
Applications:
Applications:
Applications:
Flow Analysis: Studying the behaviour of fluids around objects and within
systems.
Applications:
Applications:
Applications:
Applications:
Applications:
1.3.1 Algorithm:
Algorithm means step by step solution to provide any problem .so when to write
any program there is certain process to complete program. According to process
first we have to write problem statement of program then we can create
algorithm for the program and after algorithm we can design flow chart of
program . for above discussion let us one example of to write program of
addition of two number following are step to write algorithm. In other word ,An
algorithm is a finite sequence of well-defined, step-by-step instructions
designed to perform a specific task or solve a particular problem. Algorithms
can be implemented in various forms, including natural language, pseudo code,
or programming languages, and they provide a systematic approach to
processing data or performing computations.
1.Start
4 c=a+b
5 Show result ( c )
6 Stop
1.3.2 Flow Chart
ll the most common flowchart symbols you need to know, and how to use
them.
1.4.2 Interactive
1.4.3 Interpreted
1.4.4 Object-Oriented
Platform Independent
Benefits: Reduces the learning curve and makes it easier to maintain and
understand code.
Definition: Python includes a rich standard library with modules and packages
for a wide range of tasks (e.g., file I/O, networking, web services).
Benefits: Provides built-in functionality that reduces the need for third-party
libraries.
Installation of Python
Download Python:
Choose the appropriate version for your operating system (Windows, macOS,
Linux).
Install Python:
Run the installer and follow the prompts. Ensure that the option to add Python
to your system PATH is checked.
Verify Installation:
Website: jetbrains.com/pycharm
Website: code.visualstudio.com
Website: jupyter.org
Spyder: An IDE specifically designed for scientific and engineering
applications, offering advanced editing and debugging features.
Website: spyder-ide.org
Installation of an IDE:
PyCharm: Download and run the installer from the PyCharm website. Follow
the installation instructions and configure the Python interpreter.
VS Code: Download and install VS Code from its website. Install the Python
extension from the Extensions Marketplace within VS Code.
Jupyter Notebook: Install Jupyter using pip install notebook in the command
line. Start the notebook server by running jupyter notebook.
PyCharm/VS Code: Create a new Python project or file, write your code, and
use the built-in tools to run and debug your code.
Jupyter Notebook: Create new notebooks, write and execute Python code cells,
and visualize results interactively.