Please enable JavaScript.
Coggle requires JavaScript to display documents.
PYTHON - Coggle Diagram
PYTHON
Basics
-
Variable & Datatypes
-
- a=1 #int
- a=1.2 #float
- a=1+2j #complex
- a="gowrie" #string
- a=[1,1,'a','char',1.2] #list
- a=(1,1,'a','char',1.2) #tuple
- a={1,2} #set
- a={"key"="value","age"="20"} #dictionary
- a=None #nothing
Operaters
- Arithmetic Operators : + , - , * , / , % , // , **
- Comparison (Relational) Operators : == , != , > , < , >= , <=
- Assignment Operators : = , (arith)=
- Logical Operators : and , or , not
- Bitwise Operators : & , | , ^ , ~ , >> , <<
- Membership Operators : in , in not
- Identity Operators : is , is not
misc
- comment : # , """ """
- print : print("something")
- input : int(input("enter num")
- id function : id()
- type function : type()
- bool function : bool()
Conditional Statements
<condition> : expression that evalutes to either true or false
-
Looping Statements
- for loop
a = [1,2,3]
for item in a :
print(item) # 1 , 2 , 3
- while loop
i = 0
while i < 5 :
print(i) # 0 , 1 , 2 , 3 , 4
i++
- Guido van Rossum (1985-1990)
- National Research Institute for Mathematics and Computer Science in Netherlands during
- Inspired by Monty Python's Flying Circus,a BBC Comedy series
- It is a general-purpose interpreted, interactive, object-oriented, and high-level programming language.
cheat sheet : https://github.com/aneagoie/ztm-python-cheat-sheet