fbpx
python_i_njegove_osnove

Introduction to Python

Just as standard languages, programming languages are also used for communication. Although, in case of programming languages, they are used for communication between humans and machines (software). There are different programming languages made for different needs and they are used at different times. Some are suitable for software development, some for video game development, while others are for developing web applications, etc. In short, each programming language is suitable for a specific area. In this article, we’ll take a look at one of the currently most popular programming languages – Python.

Python was created in 1991. and its creator is the Dutch programmer Guido Van Rossum, who was employed at the Centrum Wiskunde & Informatica (National Research Institute for Mathematics and Computer Science) in Netherlands at the time the language was created.

With its gradual development, Python gained a lot of popularity. Although Guido was its main creator, the project involved a large number of people. Python is a free programming language that anyone can use and all copyrights for this language are held by the non-profit organization – Python Software Foundation.

The main feature of this programming language is its simple syntax which allows us to write very clear programs. Because of that syntax it is very easy to learn Python quickly.

In the rest of this article we will focus on the basic properties and data types of this programming language:

  • Numbers:

Variables of numeric types are created when you assign a value to them. Once created, their value remains the same. There are 3 types of numbers: whole numbers, decimal numbers and complex numbers.

  • Lists:

Lists allow us to group multiple objects of the same or different type into one whole. We form them with square brackets “[]”.

  • Tuples:

Tuples are a type of data similar to lists, but they are not changeable. We form them using regular brackets “()”, and we separate the objects with a coma “,”.

  • Sets:

Sets are a data type which does not have a defined order of elements and there are no duplicates. They are usually used to examine the affiliation of an element to a set as well as to eliminate any duplicates.

 

  • Control statements:

A control statement is a statement that determines whether other statements will be executed.

For example: if it’s raining: get the umbrella else: don’t get the umbrella.

IF statement decides whether to execute another statement, or decides which of two statements to execute. It works based on a True or False method, if the value is True, the statement behind a colon will be executed.

ELSE statement is executed when the value turns out to be False.

There is also ELIF statement which is a combination of IF and ELSE statements.

FOR statement iterates over the members of a sequence in order, executing the block each time.

WHILE loops are used to execute a block of statements repeatedly until a given condition is satisfied. And when the condition becomes false, the line immediately after the loop in the program is executed.

Those are basic data types and commands in Python. As you can see, the syntax in this programming language is very clear and understandable to everybody.

If you would like to continue learning Python, your next steps would be learning functions, modules and classes, and only after that you could say that you know the basics of Python.

Python managed to gain high popularity worldwide thanks to it’s simple syntax and a highly practical use. It became the most used programming language in university-level education in the USA, so it took precedence from Java programming language as a main language taught in programming courses.

Finally, we will list some of the biggest global companies that uses Python, some of them are Wikipedia, Google, Yahoo, CERN, Facebook, NASA, Amazon, Instagram, Spotify and many others.

 

Author: Milan Aljetić

Leave a Comment

Your email address will not be published. Required fields are marked *