News

Peculiarities of Python Syntax

Scroll Down
Published:

Python for children is the first step for future programmers. The Python programming language is fairly simple in terms of both syntax and logic and usage. In this article we will analyze the peculiarities of syntax of this language.

Python for children – a course dedicated primarily to give understanding of algorithms, reading code, understanding it and writing.

Some features of the language syntax:

  • The end of the term is the end of the instruction that means you do not need to use the semicolon line end
  • Python, as a programming language in its syntax does not have operator bumps, instead blocks are marked with indents.
  • To tabulate your instructions, you only need to indent.
  • Nested instructions are combined into blocks due to the indentation value. Indents can be any size, as long as they are the same for all nested block instructions.
  • Nested instructions in the Python programming language are written with a single template.
  • When the main statement ends with two points, it is followed by a nested code block. It’s usually with a digression under the line of basic instruction.
  • Retreats serve not only to knock them into blocks, but also to better read your code. Pure code writing is the key to a good understanding of this code.

There is a fierce debate over whether it is better to use four spaces or one tab. But each developer decides for himself. The operation of the code or its execution is not affected.

Regarding the basic syntax of the Python programming language:

  1. Python programming language is typed. You will need to work with at least two types of data: numbers and timing. There are also different types of data, for example – decimal fractions. To understand what type of object you can use the type function
  2. Operations with numbers. The main operations in the python is: the amount, the difference, the multiplication, division and rise to the degree. Regarding operations over time, there are two operations here: concatenation and repetition several times.
  3. In order to assign a value to a variable, the =symbol is used, and for comparison ==. To increase the value of the variable or add to the term, use the operator + = and to reduce – = . All these operations can interact with most types, and as we can already see with the timing, too.

Python programming is better to learn by performing constant tasks in practice. So in Medley, join the Python programming language class with us! And in every class, you’ll be creating apps, practically.

The Python programming language has the following data structures:

  • Lists. Lists are similar to one-dimensional arrays.
  • Tuple. Tuples are fixed lists.
  • Dictionaries. Dictionaries are also lists, but indexes can be of any type, not only numeric.

Register for an online lesson

Take the first step towards a successful future of your child.

Child looks up!