Python Tutorial for Beginners - #1 Expressions and Interactive Shell

in developer •  7 years ago  (edited)

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

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Please keep these coming.

Although there are a number of tutorials out there, anything that is well described and broken down into bite-size chunks makes it less daunting for new-comers.

Thanks for your feedback. I will do the best i can.

Hey, just a tip: put code in lines between `backticks`. That way the multiply sign shoes correctly instead of making part of your post italic.

Thanks for starting this Python tutorial series, it might help aspiring developers get started :)

Tanks for your reply. I will consider your tip for next articles