Summery: Python Tutorial for Beginners. Hope You Enjoy…

### What is Python?

Python is one of the easiest programming language that you can learn as a beginner. It is a high-level, general-purpose programming language. Python language was created by Guido van Rossum and released in 1991.

First of all let’s understand the basics…

### Basic Arithmetic Operations

Addition of two or more numbers can be easily done by placing the “+” sign in between the numbers.

We can divide a number by another number by placing the “/” sign in between the numbers.

Instead of “/” sign if we place “%” sign in between two numbers we can get the remainder of those two numbers.

If we add two “/” signs (“//”) in between two numbers it will round of the resulting value to the nearest whole number.

If you want to calculate the power values of a number you can do it by adding two “*” (“**”) in between the two numbers.

### Hello World

Not like other programming languages, printing a statement in python is very straight forward. You can use the print function to print a message onto the screen.

Python comments are the lines of text included inside a python script. These lines will not be interpreted by Python. Normally we use comments to describe the functionality of the code we wrote. You can add a single line comment by adding a “#” sign in front of your desire comment. (#This is a comment) If you can to add multiple lines of comments you can use triple quotes. (“””This is a comment”””)

### Lists

A list is a container which we used to store multiple data. In python lists are written using square brackets “[]”. Data inside a list is ordered and changeable. Also we can have duplicate items inside a list.

``````players = [71, 72, 73, 74]
print(players)``````

We can access the items inside the list by referring to the index number. First item inside the list is indexed as 0 second item inside the list is indexed as 1 and so on…

We can also assign new values to the items inside the list.

We can also add new items into the list.

But the above method is not permanent. If we once again check players list it results the old list.

To make this permanent we can use .append() method.

### Sets

Set is also another python collection data type. Set’s can’t have duplicates. If there are any duplicates only one is printed. These are unordered and unindexed. In python sets are written using curly brackets. “{}”.

``````names =  {'tutorials', 'overflow', 'python', 'tutorials'}
print(names)``````

You can not access access items inside a set by referring to it’s index number because sets are unordered the items has no index. But you can can loop through set by using the “for” loop.

### Dictionaries

Dictionary is also a python collection data type. These are unordered, changeable and indexed. In python dictionaries are written using curly brackets. “{}”. Dictionaries have keys and values.

``````classmates = {'Tony':'Boy', 'Emma':'Girl', 'Lucy':'Girl'}
print(classmates)
print(classmates['Emma'])``````

We can also loop through dictionaries to print out the key and value pairs.

See you from the part 02 of this tutorial.

Also Read: Python Tutorial for Beginners (Part 02)

Categories: Programming