fbpx

Writing your first code in Python

Today we are going to see about Writing your first code in Python

In case if you have missed our previous topics

  1. Python introduction in Tamil Part 1
  2. Python introduction in Tamil Part 2

Watch in youtube: https://youtu.be/Mj6HSMLvikc

Learn Python in Tamil | பைதான் மொழியைக் கற்றுக்கொள்ளுங்கள் – Writing first program in Python and executing them using Python Interpreter

Writing your first Python code

Where to write?

You can use any Notepad or Text editor for writing your Python program. But there are May IDEs available to help us with auto fill the code snippet or help us with formatting the code and check for any syntax errors.

But today we are going to write our first code, So lets use simple notepad or text editor.

Your first Python program

# This is my first Python code
# To print Hello world in the console
print("Hello World")

Save the above file in any folder with the name helloworld.py

.py is the file extension used to identify the file is Python script


Well you have now officially a Python developer, because you have written your first python code.

How to execute the Python program?

In order to execute the python program, we need Python Interpreter which will do the magic.

What is that magic?

Its the Interpretation of simple English into 0’s and 1’s, Yes the Python Interpreter is going to read your code and convert into 0’s and 1’s so that machine can understand the instructions.

To execute the Python code,
  1. You need to open Terminal or Command prompt in your Machine.
  2. Type “python3 filename.py” (In our case, “python3 helloworld.py”
  3. Hit Enter, you should see the output in the console.

Got into issue while running the program?

Goto this link https://youtu.be/Mj6HSMLvikc and comment the error message. We will have a loot at what went wrong and why the error appeared.
Writing your first code in Python, Print Hello world using python, Python interpreter how to run puthon script, how to run python file, how to save python script
Share This