2ndWeekMondayLectureNotes
2ndWeekMondayLectureNotes
Notes
MIS 131
by
Ziya N. Perdahçı
Programming Paradigms
High-Level
High-level languages look almost like
Languages everyday English and contain commonly
used mathematical notations
and
Compilers Python is among the world’s most widely
used high-level programming languages
Interpreters
• Interpreter programs execute high-level language programs directly
and avoid the delay of compilation
• Interpreted programs run slower than compiled programs
• The complete script of Python is written in the C Programming
Language. When we write a Python program, the program is executed
by the Python interpreter.
• Most widely used Python implementation—CPython—uses a clever
mixture of compilation and interpretation to run programs
Python
• Python is an object-oriented scripting language
• Released publicly in 1991
• Developed by Guido van Rossum of the National Research Institute
for Mathematics and Computer Science in Amsterdam.
• Has rapidly become one of the world’s most popular programming
languages
• Particularly popular for educational and scientific computing
• Recently surpassed the programming language R as the most popular
data-science programming language
• Source: Most used
languages among software
developers globally 2024 |
Statista
Some reasons why Python is popular:
• Open source, free and widely available with a massive open-source
community
• Easier to learn than many other languages, enabling novices and
professional developers to get up to speed quickly
• Easier to read than many other popular programming languages
• Widely used in education.
• Enhances developer productivity with extensive standard libraries and
third-party open-source libraries
• Programmers can write code faster and perform complex tasks
with minimal code
Some reasons why Python is popular:
• Massive numbers of free open-source Python applications
• Popular in web development (e.g., Django, Flask)
• Supports popular procedural, functional-style and object-oriented
programming
• Build anything from simple scripts to complex apps with massive
numbers of users, such as Dropbox, YouTube, Reddit, Instagram and
Quora
• Popular in artificial intelligence, which is enjoying explosive growth, in
part because of its special relationship with data science
Some reasons why Python is popular:
• Widely used in the financial community
• Extensive job market for Python programmers across many
disciplines, especially in data-science-oriented positions, and Python
jobs are among the highest paid of all programming jobs
CPython
• CPython is the reference implementation of the Python
programming language.
• Written in C and Python, CPython is the default and most widely
used implementation of the Python language.
• CPython can be defined as both an interpreter and a compiler as
it compiles Python code into bytecode before interpreting it.
• Anaconda is a Python distribution. It bundles CPython with
several packages, especially ones that are useful for scientific
computing, and some additional tools like Conda to manage
packages and environments.
•Python source code: We create in human-readable form to represent the logic and
functionality of our program
•Compilation: Our Python source code goes through a compilation process when we
run or execute it. The Python compiler, which is a component of the CPython
interpreter, converts our source code into CPython bytecode at this stage. This
bytecode is a set of lower-level, cross-platform instructions. It is a translator that
translates your source code into bytecode.
•CPython bytecode: After the compilation stage, the resultant Python bytecode is
produced. It is made up of a series of commands that the CPython interpreter can
comprehend and carry out. Each bytecode instruction represents a specific action or
operation that the interpreter needs to perform.
•Execution of the interpreter: The CPython interpreter now reads and runs the CPython
bytecode line by line. It executes the desired operations and produces the output or
behavior described by the source code by following the instructions given in the
bytecode.