Python Unit 1
>>>name = input("xxx:")
Input string example
print(<expression>)
Print function
Translator
converts program into executable code
Data
Information
Expressions or statements
Python inputs are
Features of algorithm
- consist of a finite number of instructions - each individual instruction is well defined (can be executed by computing agent) - describes a process that eventually halts after arriving to solution - solves a general class of problems
Basic components of hardware
- memory - central processing unit (CPU) - set of input/output devices
Steps of algorithm
1. input 2. transform information according to well-defined rules 3. output
Binary digits
Information is stored in
int
Integer string type
Guido van Rossum
Invented Python programming language
Machine code
Program stored in memory represented in binary digits, or
.py
Python extension
interpreted language
Python is a
program libraries
Save/share Python files in
Algorithm
Sequence of steps that describes computational processes
Python
a high-level general-purpose programming language for solving problems on modern computer systems
Mainframe computers
consisted of vacuum tubes, wires, and plugs. filled entire rooms
IDLE
easiest way to open a Python shell
Run-time system
executes program if no errors are found
float
floating-point numbers type
Computing agent
human being
Random access memory
internal/primary memory
External/secondary memory
magnetic, semiconductor, or optical
operating system
most important system software
Hardware
physical devices required to execute algorithms
High level programming language
resembles English and allow the author to express algorithms in a form that people can understand
Syntax
rules for forming sentences in a language
Shell
runs simple Python expressions and statements
Software
set of algorithms, represented as programs in particular programming languages
Loader
takes a set of machine language instructions as input and loads them into the appropriate memory locations
How computers communicate
through ports that connect them to networks
Syntax errors
translator checks for
Applications
web browsers, word processors, spreadsheets, etc...
Text editor
where high-level language statements are written