Chapter 1 Python
Chapter 1 Python
Eyob S.
AAiT
May , 2024
1 Course Outline
2 Chapter 1: Introduction
Introduction
Computation
History of computing and programming
Generations of Computers
Structure of a basic Computer System
Classification of Computers by Size
3 Programming Constructs
4 Programming Language
Course Outline
What is computation?
Variables
Built-in Functions
Function calls
Flow of execution
Function composition
Conditional Execution
User-Defined Functions
Return vs Print
Function Scope
Looping Basics
String as a sequence
Indexing
Searching
String Comparison
Lists
Numerical Indexing
Dictionaries
File
Pickling
Object Modelling
Lab........................... 20%
Project...................... 20%
Test/quiz................... 10%
Assignments............... 20%
Introduction
there are theoretical works in CS, which do not make use of real com-
puters: even the early work in CS took place before the development
the science that deals with the theory and methods of processing in-
What is Computation?
chine (www.dictionary.com)
an algorithm). (en.wikipedia.org)
The term is used in a variety of senses, from the very definite arith-
computations,
education etc
The earliest known calculating device is probably the abacus. The aba-
Figure: Abacus
only way they know how - by repeated addition according to the method
of finite differences.
the bombe.
solve a problem
Generations of Computers
The two notable machines of this era were the UNIVAC and ENIAC
machines – the UNIVAC is the first commercial computer which was
purchased in 1951 by a business – the US Census Bureau.
The early versions of these machines were developed for the atomic
energy industry.
These were the first computers where users interacted using keyboards
Intel developed the Intel 4004 chip in 1971, which positioned all com-
puter components (CPU, memory, input/output controls) onto a single
chip.
Other major advances during this period have been the Graphical user
interface (GUI), the mouse and more recently the astounding advances
in lap-top capability and hand-held devices.
Often there are many inputs and outputs. Some of the outputs are
required and some are waste products. To a greater or lesser extent,
all processes generate some waste heat.
These are arguably the most powerful in terms of speed and accu-
racy. They are useful in problems that require complex mathematical
computations.
They are capable of executing trillions of instructions per second, which
is calculated in floating point operations per second (FLOPS). They
also don’t come cheap as they can be priced between 200, 000 to over
100 million.
Microcomputers are the smallest, least expensive and the most used
computer systems. They have a small memory, less processing power,
are physically smaller, and permit fewer peripherals compared to super
and mainframe computers.
They are more commonly known as personal computers or simply PCs.
Categories of personal computers include: Desktop computers, Mobile
computers, Wearable computers.
These are the smallest possible computers which mimic the shape and
functionality of full-size desktop motherboards.
An SBC can easily be confused with an embedded system because of
its size but is not, because it permits general purpose functionalities
synonymous with microcomputers.
The old cell phones used well before the smartphones became a phe-
nomenon, could easily fall under the category of embedded systems
since their sole purpose was to make and receive calls.
Programming Constructs
Syntax errors are encountered after the program has been executed.
It tells about the meaning, and helps interpret what function the line
of code/program is performing.
The semantic errors are handled during runtime of the program execu-
tion.
Low level
High Level
Interpreted
Compiled
Thank You!!!