Python
Beginner Level - Chapter 1
Introduction. Functions.
Why Python?
● Python has a simple syntax similar to the English language.
● Python runs on an interpreter system, meaning that code can be executed as
soon as it is written. This means that prototyping can be very quick.
● Python can be treated in a procedural way, an object-oriented way or a
functional way.
What can Python do?
➔ Python can be used on a server to create web applications.
➔ Python can be used alongside software to create workflows.
➔ Python can connect to database systems. It can also read and modify files.
➔ Python can be used to handle big data and perform complex mathematics.
➔ Python can be used for rapid prototyping, or for production-ready software
development.
Install and Setup
Download and install Python
[Link]
We can add the directory (C:\Python) to PATH.
C:\python>python --version
Python 3.14.2
C:\python>py
Python 3.14.2 (tags/v3.14.2:df79316, Dec 5 2025, 17:18:21) [MSC v.1944 64 bit (AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
Install VS Code
1. Open your web browser and go to
[Link]
2. Click on the blue Download button.
VS Code supports all sorts of languages. We are going to use it
with Python, so the last thing we need to do is to let VS Code
know that.
Once VS Code knows that we’ll be using Python, it may install
extra software so that we’ll have all the Python support we’ll
need.
Run Python File
C:\Users\kth>py c:\python\[Link]
Is your mark passed or failed ?
90
Your Mark is 90 And you are passed
Procedural programming
1. Sequence
2. Selection
3. Loop
4. Function
Sequence
Sequence
1. top - bottom
2. left - right
3. ()
Sequence သံုးမျ ိုး
1. အေပါ်ေအာက်
2. ဘယ်ညာ
3. ဝိုက်ကွင်း
Functions
Functions are bits of code that perform specific tasks. You’ve actually seen one function
already: the print() just that, it prints (or displays) text.
In Python, like in most other programming languages, functions are used by referring to their
name followed by parentheses. When programmers use functions, they say that they are
calling the function.
The Function, print() to print is called an argument, and arguments always go in between ( and ).
Programmers refer to this as passing arguments.
Functions
How many arguments does a function accept?
Well, that depends on the function.
Some functions accept no arguments, and others accept one or
more arguments, in which case these will be passed when calling
the function.
And whether there are arguments or not, you always need the parentheses,
function_name ().
Functions
There are two arguments this time, and print() displays them both in the Terminal window
The quotation marks and comma is to show you something important.
When you pass more than one argument to a function, you must separate each argument with a comma.
No comma is needed if there is just one argument, but for two or more arguments, make
sure there is a comma between each.
Comments
Comments can be used to make the code more readable.
Comments starts with a #, and Python will ignore them execution.
#This is a comment
print("Hello, World!")