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.
Operator | Operation | Expression | Result |
---|---|---|---|
** | Exponent | 3 ** 3 | 27 |
%% | Modulus | 24 %% 9 | 6 |
+ | Addition | 5 + 6 | 11 |
- | Subtraction | 6 - 5 | 1 |
* | Multiplication | 6 * 5 | 30 |
/ | Division | 10 / 4 | 2.50 |
To - Do
- Execute five or more expression has multiple calculations.
- Execute five or more expression has parenthesis. (Ex. (5 - 1) * ((7 + 1) / (3 - 1))) yeah lots of parenthesis.
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.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thanks for your feedback. I will do the best i can.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
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 :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Tanks for your reply. I will consider your tip for next articles
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit