Understanding Python (Part-1)

Ignoramus
2 min readAug 4, 2020

Python is a fastest growing programming language. It is an ideal programming language. And the reason why it is so because

  1. Fewer lines of code: A complex code in any other language involving a lot of lines of code to work, but in python it can be simpler.
  2. Multipurpose language: can be used for data science, programming, web apps, mobile apps, AI/ML, Automation,etc.
  3. High level
  4. cross-platform
  5. Huge community: A lot people use python to fulfill their needs in different sectors as data science, statistics, web development, testing.
  6. Large ecosystem: What we are trying to do has been already done by many before as python is existing since past 20 years.

Installation

  1. I downloaded Anaconda in which python was pre-installed. To download the same way visit Anaconda.com and choose latest version python graphical installer(which in my case was python 3.8) and download it.
  2. Once downloaded open the anaconda.exe by clicking on it.
  3. Select Next
  4. Select I agree after reading the terms
  5. Select Just me and click on Next
  6. Then Note down your file location and proceed
  7. Now this is an important step you need to check the box stating Add anaconda to my path. Otherwise you won't be able to operate in anaconda. And then install.

It may take some time to install. After installation You can open the windows command prompt or anaconda command prompt and check for pip and conda package installation. To check pip package installed and version the codes goes like this-

pip --version

Now if the package wouldn’t have been pre-installed then it would have shown an error. But if it is pre-installed, we can see the version of pip that is installed, along with the path. Now to check the conda version in the similar way we can use -

conda --version

So, we can see the version of conda that is installed. While installing anaconda we get few pre-installed packages along with editors as VS code. We can write programs and check whether its working or not.

Types of object in Python

The most common object types are integer, float, strings. Integers are +ve and -ve numbers, float is real numbers, while strings is word or text. And we can also check for their type.

a = 1b = 1.3c = "Rajnikanth"a,b,c

Output :

(1, 1.3, 'Rajnikanth')

To check type :

type(a)inttype(b)floattype(c)str

It also has one more datatype boolean which has two values True and False. When we check for expression then we can get

In :

2>1

Out :

True

In :

2>5

Out :

False

In :

type(True)

Out :

bool

In :

type(False)

Out :

bool

--

--

Ignoramus

“If you torture the data long enough, it will confess to anything.”