Python Introduction: 1 Overview About Compiler, Practical Part
Python Introduction: 1 Overview About Compiler, Practical Part
University of Zakho
Department of Computer Science
Third Year Students
Compiler Design (Practical Part)
• Networking
3 Why Python?
• Python works on different platforms (Windows, Mac, Linux, Rasp-
berry Pi, etc).
1
• Python has syntax that allows developers to write programs with fewer
lines than some other programming languages.
The following are some examples how to run python using CMD:
> 2 + 2
4
> 50 − 5∗6
20
> (50 − 5∗6) / 4
5.0
> 8 / 5 # d i v i s i o n a l w a y s r e t u r n s a f l o a t i n g p o i n t number
1.6
We will be using an editor to write python code in the future labs.
The first part of the course (Lab) will be describing how these structures
can be implemented in Python.
The second part will be implementing a simple compiler (the first three
steps) for a simple language. This means that you will need to understand
the first part to complete the second part.
2
5 How to Follow Lab Instructions
At the day before each lab started, instructions will be available in the moo-
dle system. You will need to print these instruction (one pdf file) before
attending the labs. Please make sure you have this file before at-
tending the labs. This will help you how to follow the labs and make it
easy to understand what to do in each lab.
All you have to do is to follow given instructions and combine code into
a single file step by step. You will be allowed to change or add new code, if
needed. If you get any problems or errors in the lab do not hesitate to ask.
6 Teaching Methods
The most recent version of Python is Python 3.8.5, which we shall be using
in this course. Any version of python more than 3 is recommended. In
this course, Python will be written in a text editor. This will be one of the
available Integrated Development Environments and editors, such as Spider,
Pycharm, Netbeans or Eclipse which are particularly useful when managing
larger collections of Python files. We will tell you which one is best to be
used.
In this lab, students will be learn which software will be used and how to
write a simple expressions using python, if needed. If you have any questions
regarding the whole python and the required software, this is the right time
to ask.
1. https://docs.python.org/3/tutorial/
2. https://www.w3schools.com/python/