Python Tutorial for Beginners - #1 Expressions and Interactive Shell

python-python.jpg
The Python programming language has a very easy syntax (like grammar for programming language). Therefore you don't work for hours to learn programming language's syntax and easily start developing programs. Nevertheless you have to learn some basic programming concepts. At the start you might think these concepts seem complicated, but with some practice, you’ll be write some apps and control your computer.

Python has a cool interactive shell. This shell, lets you run python commands and shoe the results instantly. You run the interactive shell by typing python to terminal if you are using Linux or MacOS. If you are using Windows please search on Google. This tutorial wrote on Manjaro Linux.

A window with the >>> prompt should appear; that’s the interactive shell. Type 5 * 7 at the console and hit Enter. Python do some simple math.

>>> 5 * 7
35

In Python jargon, "5 * 7" is called expression, which is the most basic kind of programming instruction in the language.

Operators are the constructs which can manipulate the value of operands. Table in the below, has all the math operators in Python programming language.

OperatorOperationExpressionResult
**Exponent3 ** 327
%%Modulus24 %% 96
+Addition5 + 611
-Subtraction6 - 51
*Multiplication6 * 530
/Division10 / 42.50

To - Do

  1. Execute five or more expression has multiple calculations.
  2. Execute five or more expression has parenthesis. (Ex. (5 - 1) * ((7 + 1) / (3 - 1))) yeah lots of parenthesis.

Next Chapter: Variables and Data Types

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center