Python Tutorial Sinhala Easy Learn Programming Basics

Logan Jul 13, 2026

Ready to dive into the world of Python programming? You're in luck! Today, we're embarking on an exciting journey to learn Python, the second most popular programming language in the world, through a comprehensive guide tailored just for you in Sinhala, the language of Sri Lanka. Whether you're a beginner eager to explore the world of coding or an experienced developer looking to expand your skill set, this Python tutorial is designed to cater to all levels.

Python Coding Practice | Easy Programming Logic
Python Coding Practice | Easy Programming Logic

Why Python, you ask? Python is an interpreted, high-level, and general-purpose programming language that's easy to learn, read, and write. It supports multiple programming styles, including procedural, object-oriented, and functional programming. From data analysis and machine learning to web development and automation, Python is versatile and incredibly powerful. So, let's roll up our sleeves and get started!

Python Tutorial
Python Tutorial

Getting Started with Python

Before we dive into the nitty-gritty of Python, let's first ensure you have the right tools to kickstart your learning journey.

Fastest way to learn python for free.
Fastest way to learn python for free.

1. **Python Installation**: Download and install Python from the official website (https://www.python.org/downloads/), ensuring you tick the 'Add Python to PATH' option during installation. This will allow you to run Python commands directly from your command prompt or terminal.

Python Environment Setup

All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)

For better organization and isolation of your projects, it's recommended to use a virtual environment.

First, open your command prompt or terminal and check if Python is installed correctly by typing:

```bash python --version ```

If the output displays a Python version number (e.g., Python 3.8.5), your installation is successful. Now, create a virtual environment using the following command:

Python Sinhala Tutorial Lesson 5 Common Data Types and String Concatenation පයිතන් සිංහල
Python Sinhala Tutorial Lesson 5 Common Data Types and String Concatenation පයිතන් සිංහල

```bash python -m venv myenv ```

Then activate the environment:

```bash # On Windows myenv\Scripts\activate # On macOS and Linux source myenv/bin/activate ```

Python Integrated Development Environments (IDEs)

While you can code in Python using any text editor, using an IDE can drastically improve your productivity and development experience. Popular Python IDEs include:

Python Sinhala Tutorial Lesson 1 පයිතන් සිංහලෙන් හැදින්වීම සහ ස්ථාපනය
Python Sinhala Tutorial Lesson 1 පයිතන් සිංහලෙන් හැදින්වීම සහ ස්ථාපනය
  • PyCharm (https://www.jetbrains.com/pycharm/)
  • Visual Studio Code (https://code.visualstudio.com/) with the Python extension
  • Thonny (https://thonny.org/) – a beginner-friendly IDE

Python Basics: Syntax and Data Types

Python tkinter Toolbox
Python tkinter Toolbox
9 Python Loop Tricks Every Beginner Should Learn (Cheat Sheet)
9 Python Loop Tricks Every Beginner Should Learn (Cheat Sheet)
9 Python Projects for Beginners (Build Your Portfolio Fast)
9 Python Projects for Beginners (Build Your Portfolio Fast)
a man is smiling and pointing to the camera with his hand in front of him that says master python in 60 days watch all the end for details
a man is smiling and pointing to the camera with his hand in front of him that says master python in 60 days watch all the end for details
Ultimate Python Cheat Sheet for Beginner
Ultimate Python Cheat Sheet for Beginner
a computer screen with the words python string method
a computer screen with the words python string method
Python Notes for Beginners (Easy + Quick Guide)
Python Notes for Beginners (Easy + Quick Guide)
a poster with the words, what is list slicing in python? and how to use it
a poster with the words, what is list slicing in python? and how to use it
Learn Python Online (2022): 22 Best Python Courses and Tutorials For Beginners
Learn Python Online (2022): 22 Best Python Courses and Tutorials For Beginners
How to read Multiple Columns from CSV File in Python? With Source Code
How to read Multiple Columns from CSV File in Python? With Source Code
the top 50 python project ideas
the top 50 python project ideas
Python Projects Ideas For Beginners
Python Projects Ideas For Beginners
Python Kivy Projects
Python Kivy Projects
Python to_timestamp Easiest Way to Implement with Examples
Python to_timestamp Easiest Way to Implement with Examples
Python File Handling Explained for Beginners (Complete Guide)
Python File Handling Explained for Beginners (Complete Guide)
The Complete Python 3 Beginners Tutorial [Full Course] | Coding Made Easy | Learn Python
The Complete Python 3 Beginners Tutorial [Full Course] | Coding Made Easy | Learn Python
Python Tutorial: CSV Module - How to Read, Parse, and Write CSV Files
Python Tutorial: CSV Module - How to Read, Parse, and Write CSV Files
How to Set Up Python the Right Way (2025 Beginner Guide)
How to Set Up Python the Right Way (2025 Beginner Guide)
Python Basic | Part 38
Python Basic | Part 38

Now that we have our environment set up, let's dive into the core concepts of Python – syntax and data types.

Python uses indentation to define blocks of code. The standard indentation is 4 spaces or a tab. Here's a basic 'Hello, World!' example:

```python print("Hello, World!") ```

Basic Data Types

Python supports various data types, including:

  • Numeric Types: int, float, complex
  • Text Type: str
  • Sequence Types: list, tuple, range
  • Mapping Type: dict
  • Set Types: set, frozenset
  • Boolean Type: bool

Here's how you can assign values to these data types:

```python # Integer x = 5 # Float y = 3.14 # String name = "John Doe" # List fruits = ["apple", "banana", "cherry"] # Tuple point = (3, 5) # Dict student = { "name": "Jane Doe", "age": 20 } # Set unique_numbers = {1, 2, 3, 4, 5} # Boolean is_learning = True ```

Variables and Naming Conventions

Variables in Python are used to store data values. Following a good naming convention makes your code more readable and maintainable. Here are some naming guidelines:

  • Variable names should be descriptive and lowercase, with words separated by underscores (snake_case).
  • Use singular or plural nouns for variable names, e.g., user_name.

For example, consider the following valid variable names:

```python user_name = "John Doe" age_in_years = 30 is_student = False ```

Python Control Flow: If-elif-else Statements and Loops

Now that we're familiar with Python's basics, let's explore how to control the flow of our programs using conditional statements and loops.

In Python, the if-elif-else statement allows you to execute different blocks of code based on given conditions:

```python age = 15 if age < 18: print("You are a minor.") elif 18 <= age < 60: print("You are an adult.") else: print("You are a senior citizen.") ```

Loops: for and while

Python offers two types of loops: for loops for iterating over sequences (like lists, tuples, or strings), and while loops for iterative execution based on a condition.

Here's an example of each:

```python # For loop fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit) # While loop i = 0 while i < 5: print(i) i += 1 ```

You can also use the break, continue, and pass statements to control the flow of your loops:

  • break: Terminates the loop prematurely.
  • continue: Skips the current iteration and moves to the next one.
  • pass: A placeholder for future code or when no action is required.

Now that you've learned the basics of Python, it's time to apply your newfound knowledge and start creating some awesome projects! Stay curious, and happy coding!