Lecture-1-Introduction To Python
Lecture-1-Introduction To Python
Introduction to Computers
and Python Programming
The CSC213 Team
Main Text for this Course
Title
Starting Out with Python
(2018, 4th Edition)
Download at Request
Topics
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
Topics | Lecture Progress
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
Introduction
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
Hardware and Software
Central processing unit (CPU): the part of the computer that actually
runs programs
Most important component
Without it, cannot run SOFTWARE
Used to be a huge device
Microprocessors:
CPUs located on small chips
Main Memory
Input:
Data the computer collects from people and other devices
Input device:
Component that collects the data
Examples: keyboard, mouse, scanner, camera
Disk drives can be considered input devices because they load programs into the
main memory
Output Devices
Output:
Data produced by the computer for other people or devices
Can be text, image, audio, or bit stream
Output device:
Formats and presents output
Examples: video display, printer
Disk drives and CD recorders can be considered output devices because data is sent
to them to be saved
Software
System software:
Programs that control and manage basic operations of a computer
Operating system: controls operations of hardware components
Utility Program: performs specific task to enhance computer operation or safeguard
data
Software development tools: used to create, modify, and test software programs
Topics | Lecture Progress
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
How Computers Store Data
Digital:
Describes any device that stores data as binary numbers
Digital images are composed of pixels
To store images, each pixel is converted to a binary number representing the
pixel’s color
Digital music is composed of Sections called Samples
To store music, each sample is converted to a binary number
Assignment-1.1
20
Topics | Lecture Progress
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
How a Program Works (1 of 3)
Low-level language:
Close in nature to machine language
E.g. Assembly Language
High-Level language
Allows simple creation of powerful and complex programs
No need to know how CPU works or write large number of instructions
More intuitive to understand
Key Words, Operators, and Syntax:
an Overview
Key words: predefined words used to write program in high-level
language
Each key word has specific meaning
Operators: perform operations on data
Example: math operators to perform arithmetic
Syntax: set of rules to be followed when writing program
Statement: individual instruction used in high-level language
Compilers and Interpreters (1 of 3)
Interpreter:
Translates and executes instructions in High-level Language Program
Used by Python Language
Interprets one instruction at a time
No separate machine language program
Source code:
Statements written by programmer
Syntax error: prevents code from being translated
Compilers and Interpreters (3 of 3)
31
Topics | Lecture Progress
Introduction
Hardware and Software
How Computers Store Data
How a Program Works
Using Python
Using Python
When you start Python in interactive mode, you will see a prompt
Indicates the interpreter is waiting for a Python statement to be typed
Prompt reappears after previous statement is executed
Error message displayed If you incorrectly type a statement
Good way to learn new parts of Python
Script Mode