Introduction to Modern Python
Tags: python, tutorial, 100daysofcode
Published: 2022-02-21 18:53:53


Python is among the most popular programming languages in the world. It is ranked high in different StackOverflow programming surveys each year. This article helps beginners familiarize themselves with the basic concepts of Python. According to the official documentation, Python is a high-level and general-purpose programming language.

Python was built to be easier to use than other programming languages. It’s usually much easier to read Python code and much faster to write code in Python than in other languages.

##Getting Started with Python
First of all, to check the version of Python installed in your machine, type as follows in the terminal.

![Check Version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yg4m5dxiabwap3e9ta74.png)

If there is no Python installed, you can install it using the instuctions in the official website [Download Python](https://www.python.org/downloads/)

##First Python Code
We are going to write our first Python program which prints out our name by typing in our preferred code editor as follows:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nrzlr3fedi150s50obkq.png)

We then run our first python code by navigating to the directory where we have saved the file then run it:

![Python Program](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jas23c9k3gndasrz6718.png)

Alternatively, we can run the python code directly from the terminal since it is quicker and easier.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ag6mifa8qulmxesxzpy.png)

That's it we have created our first python program. To exit the terminal,you type **quit()**

##Python Syntax
Like any other language, Python also follows a given set of rules such as:
>>
1. Python is case-sensitive, which means, for example, Name and name have different meanings.
2. The standard is to use English names in programming.
3. All variables should start with a lowercase letter, eg, var = 4.
4. Functions begin with lowercase.
5. Classes begins with a capital letter.

##Variables and Data types.
Variables are the basic unit of storage for a program. Programs perform operations on variables and alter or fill in their values. Objects are higher level constructs that include one or more variables and the set of operations that work on these variables. Let's try creating variables to store data.
![Variables](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4k3fa8fl3paplsh8lnv.png)
To check for the data type of a variable, you proceed as shown below:
![Check Data Type](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c999igh2f4xyoqgykdai.png)

##Classes and Objects
Every Object belongs to a certain class. Classes are abstract descriptions of the structure and functions of an object. Objects are created when an instance of the class is created by the program. For example, “Fruit” is a class while an “Apple” is an object.

Congratulations on creating our first Python program and getting a brief introduction. In the next Python post, I am going to focus on Data Structures in Python.