Getting Started with Coding Using Python 3

A complete beginner's guide to start coding with Python 3 - Part One

ยท

3 min read

First things first. Why do you want to learn to code? Is it because of the movies you watched that inspire you? Is it because you have assignments to do in python? or simply because you want to be smart and show off a bit (no harm in that though ๐Ÿ˜)

The way I see it, coding or programming is just writing in English, but...here's the catch - it's just focusing on the key words and omitting other articles. Thatโ€™s simple to start off with right ! We could work with that !

This article will be using very simple terms, by which I mean that there will be not much technical terms involved. Technical terms in general might be overwhelming for some absolute beginners. I know it was for me when I started to learn coding. However, as we advance, there will be some subtle dropping of technical terms which by then would be much easier for you to understand.

(Disclaimer : This tutorial is for absolute beginners to just get started with programming with python 3)

I. Getting Started

Now, to write your code and to run it (making it work), you need an editor. Think of it as notebook where you write down your stuff. Similarly, in an editor you would be typing your code to get the corresponding output/results.

1. An online editor :

There are many online editors available. In some you can save your work and in some you may not able to. One of the biggest advantage of using an online editor is that there's no set up required. There's no need to download editors or IDEs (Integrated Development Environment ). You can just dive into coding using your browser itself. A few online editors that I would recommend are as follows :

Tutorialspoint

https://www.tutorialspoint.com/execute_python3_online.php

Programiz

https://www.programiz.com/python-programming/online-compiler/

2. An IDE - Integrated Development Environment

What is this now? An IDE is basically a software that helps you combine different tools used for development. It helps you in creating applications and in software development.

Anaconda Navigator (My Favourite)

image.png

Anaconda Navigator has python editors - Spyder, Jupyter Notebook, VS Code. For a beginner, I would recommend Jupyter Notebook. The interface is simple to understand and to work with. You may refer to the link below to get started with Anaconda Navigator.

https://docs.anaconda.com/anaconda/install/

II. Let's Dive In !

Print

Let's start with a very very simple line of code.

print("Hello World!")
>>Hello World!

Type first line shown above in your editor and press 'Run'.

As you can see, the ouput is : Hello World!

You don't see the word 'print' along with the parantheses and double quotes that's because they are the syntax of the language python, that tells the computer to print the words that are inside the double quotes.

Comments

Coming to the next easy yet essential part in coding - commenting.

Comments are just texts that tell you the role of a snippet code (a small part of code that performs a function). They are not a part of the code hence they cannot be executed.

Any line with // in front it will be considered as a comment and won't be executed as a part of the code.

print("Roses are red, violets are blue") // and I'm not going to continue! Hah!
>>Roses are red, violets are blue

In the above example you can see what part of the code is executed.

[Test yourself : try using //("Does it print now?")]

ย