Professional Documents
Culture Documents
Table For Keywwords
Table For Keywwords
Keywords
KEYWORD DESCRIPTION
COMMAND
"and" logical and: True
and False == False
"as" part of the with as statement: with
X as Y: pass
*** "assert" ensure that something is true:
assert False, "Error"
*** "break" stop this loop right now or stop a
while True: break
loop:
*** "class" define a class:
class Person(object):
*** "continue" a command for a loop which shows
"don't process more of the loop,
while True: continue
do it again":
DATA TYPES
Type Description
Example
True Boolean True value True or
False == True
False Boolean True value True and
False == False
None represents "nothing" or "no value" x = None
bytes stores bytes maybe of txt or png or file etc. x =
b"hello"
strings stores textual information x =
"hello"
numbers/int stores integer value x = 123
floats stores decimals x = 12.45
lists stores data in lists j = [12,
"hello", 343, "I HATE IT!"]
dict stores key = value mapping things e = {"x":
1, "t": 4, 45: "hello"}
OPERATORS
OPERATOR DESCRIPTION EXAMPLE
+ addition 2 + 4 = 6
- substraction 4 - 2 = 2
* multiplication 4 * 2 = 8
/ division 4 / 2 = 2
% modulus gives remainder 2 % 4 = 2 or 4
% 2 = 0
** power of or exponents 2 ** 4 == 2 *
2 * 2 * 2 = 16
// floor division 2 // 4 = 0
when 2 / 4 = 0.500 so the floor division value here is first of quotient
< less than 4 < 4 == False
> greater than 4 > 2 == True
<= less than equal 4 <= 4 == True
>= greater than equal 4 >= 3 == True
== is equal to 3 == 3 == True
!= not equal to 3 != 4 == True
( ) paranthesis len('hi')
[ ] list brackets [1, 2, 3]
{ } dict curly braces {'x': 1, 'y':
3}
*** @ at(decorators) @classmethod
, comma to add more range(0, 10)
: colon in function it signifies def X():
starting of a block of code
. dot used for more attributes over self.x = 10
variable
= assign equal to x = 10
*** ; semi colon print("hi");
print("there")
+= add and assign x += 1
-= substract and assign y -= 2
*= multiply and assign x *= 3
/= divide and assign y /= 2
*** //= floor divide and assign x //= 4 here 4
is divisor x/4 will give an 'n' floor value
first divide and find floor value
*** %= modulus and assign x %= 2 here 2
is divisor and x/2 will give a remainder which will be assign
**= power assign x **=2 this
will assign x^2 = x
CLASS COMMANDS (X,M,J,K,Q and foo are like blank spots where we can designate them)
COMMAND DESCRIPTION
EXAMPLE
class X(Y) Makes a class named X that is-a Y
"is-a" a phrase to say that something is
salmon is-a fish
inherited from another.
"has-a" a phrase to say that something is
salmon has-a mouth
composed of a trait
class X(object): class X has-a __init__ that takes
these can also be called as attributes
def __init__(self, J): self and J as a parameters
libraries to be learn
1. pandas***
2. python-dateutil
3. pendulum
4. NumPy***
5. Pywin32
6. Pytest
7. Seaborn
8. MoviePy
9. pip
10. Matplotlib***
11. PyKeyboard##
12. pyautogui##