Skip to content

Introduction

Python is high level, Dynamically typed, Garbage collected, interpreted language Designed by Guido van Rossum originally released with version 0.9.0 in 1991.

the language can be described as batteries included with how comprehensive it is, as we will discuss on upcoming articles about it, but to cut stories short, it's a gem when it comes to do basic and extensive data science and math, and we will apply it a lot on math here on this site.

Syntax

the Syntax of Python is very easy to memorise that the only problem you need to solve is yours (Not you, but the problem you need to solve, duh).

Printing Out (stdout)

print("Hello mom and dad!")
in case there is any other data you want to add your print command you can simply add + after closing the first string like this:

a = "Dad"

print("I love " + a)

Input (stdin)

reading input from user can be done with one line like this:

a = input("Please Enter variable a:")

notice we have written inside input function, this prints out message requesting the user to enter data be it number string this isn't our concern for now.

Arithmetics

since this website is mainly focused on coding and math (and obviously other topics which may come in future) then understanding arithmetics of said language is very important, here is a list of them:

  • '+' add (\(m+n\))
  • '-' subtract (\(m-n\))
  • '/' divide (\(m/n\))
  • '*' multiply (\(m*n\))
  • '%' remainder of division (Basically the Remainder of \(m/n\))
  • '**' double asterisks is raise to the power as in (\(m^n\))

I should note out that like math there is sequence to math operations, first the parentheses (), then the powers raised on top of them, then normal arithmetics follows * -> / -> + -> -

a = 5 * 5**2 + (2+8)
~~~^ 3 ~~~~~~^2 ^----^1

    5 + 125 + 10 = 135

print (a)
> 135

Next: Condition Operations and loops

for (if) the syntax is as follows

if condition:
    do_something
else:
    do_something_else

and for the (for loop) it is as follows

for i in range(start,end):
    do_thing_repeatedly;

this will conclude the introduction to python, this start can help us grasp basic understanding on the programming language side of math programming.

Below are Links to learn more