CS111 - Fundamentals of CS General Program - General
CS111 - Fundamentals of CS General Program - General
Introduction to Python
Sabah Sayed
Remember: Difference between an algorithm, a
program, and a process
Represented Executed
Problem
Solved Algorithm as Program as Process
by
Why convert algorithm to a program?
Programming
language
What is a program?
• A set of instructions (i.e., algorithm) that are used to solve a
problem and are written in a programming language
– e.g., FORTRAN, COBOL, Lisp, Basic, Pascal, C, C++, Java, C#, Python,
…
• The person who write computer programs is called
Programmer/developer
• The computer programs are called software
Program
The steps to solve a problem
• Writing a program in a programming language is composed of 2
phases:
1. Implementation phase (by Developer): A developer write a program using
syntax of a specific programming language
2. Compilation phase (by Compiler): By
Developer
• A compiler checks the syntax errors inside a program By
• Convert a program into machine language (i.e., 0’s and 1’s) Compiler
Compiler vs. Interpreter
• Compiler reads the entire program and convert it into
machine code
– Used by some programming language, e.g., C++
• Interpreter reads one statement at a time from the program
and convert it into machine code
– Used by some programming language, e.g., python
• The machine code is the code that the computer can
understand and run directly.
Compiler vs. Interpreter (cont.)
Why Python?
• Easier syntax, more readable, shorter programs.
• Has large libraries of various built-in functions.
• Portable, runs on Unix, Mac, and windows.
• Scalable, used for small and large programs.
• Interactive, can write and test programs from terminal.
• https://www.python.org/downloads/
Installing Python