Python - Getting started

31-Dec-2023

Kickstart your Python journey with essential steps. Learn how to set up Python, write your first program, and grasp fundamental concepts, providing a solid foundation for your exploration into Python programming.

Python is a friendly and powerful programming language known for its simplicity. It's like a toolbox for coding, used in everything from websites to smart gadgets. With its easy-to-understand rules and helpful tools, Python is great for both beginners and pros. It's like a secret weapon for solving all kinds of problems in the coding world. Dive in and discover the magic of Python!


Installing Python :

Getting the newest Python on your computer is super easy. Go to Python.org, pick the one made for your computer (Windows, Linux, macOS, etc.), and hit download. After it's downloaded, just run the installer and click through the default options. That's it – Python is ready to go!


Once you've installed Python on your computer, make sure it's working right by typing the following command into your CLI or Terminal.


python --version

Output :


Python 3.11.2


Installing VSCode :

Getting VSCode is easy peasy. Just download the stable build from the official website and install it. It works on different operating systems, including web browsers.


Installing Essential VSCode Python Extensions :

Using VSCode for Python is a snap. The Python extensions in VSCode cover everything from editing to testing. Just click the box icon or press Ctrl + Shift + X to open the extension panel. Type a keyword in the search bar, and voila, explore a variety of helpful extensions.

For us, we'll type "Python" and install the Python extension by clicking on the install button, like you see above.

Running Python in VSCode :

Once you've got Python and VSCode installed, let's write and run a simple Python code in the IDE. When you open it, you might see a welcome note – just ignore that for now. Head to File > New Text File or hit Ctrl + N to create a new file. Write a basic print statement like "Hello World," then save it with Ctrl + S. Pick a directory, name your file, and make sure to add .py at the end of the file name. That's it!

To execute the Python file, just click the Run button at the top left. This action will kick off the terminal and run the Python file, showcasing the output.



Comments

First Image
First Image
First Image
First Image