Skip to main content

Introduction to Python

Who cares who made it. just use it.

Indentation

Indentation is the spaces at the beginning of a code line. This tells the code that a particular line is enclosed within the parent code line. eg

if 5 > 2:
print("Five is greater than two!")

means that if 5>2 do nothing

if 5 > 2:
print("Five is greater than two!")

but this one tells that if 5>2 then run the print statement or any statement that is under current line.

Simple Terms

print("this is how to print a statement")
  • < , > , >=, <= ``
OperatorFunction
+Adds 2 Numbers
-subtracts
/is divide (3/2 = 1.5)
//is absolute divide (3//2=1)
%is modulo (reminder of division)
comparision symbols
!means not (eg 1!=2 means 1 is not equal to 2 which is true statement)

comparision symbols are >, < , >=, <= etc.