OrgPad logo

Every Thing I Know About Python

Created by suraj ghalley

Every Thing I Know About Python

Arthimetic Operator

presedent of operator

  1. () Paranthesis 
  2. ** Exponential R to L
  3. *Multiplication, / Division, % Modulus, // Floor  L to R
  4. +Addition, -Subtraction L to R

Logical Operator

Bit Wise Operator

Comperision Operator

(==) equal to

(!=) is not equal to

(>=) is greater than or equal to

(<=) is samller than or equal to

(>) is greater than

(<) is smaller than

Member ship operator

Screenshot 2024-09-24 145154

#True

#False

#False (case sensitive)

Operator

Identity Operator

while Loop

Loop

For loop

For Else loop

Binary number number System

Octal Number System

\n

  1. \n  it will move curser in new line

    Screenshot 2024-09-22 062457

Decimal Number System

Integer Values

All number values that we have learn in math.

Hexadecimal Number System

A=10, B=11, C=12, D=13, E=14, F=15

print(0xA7)#167

print(0XA7)#167

Escape squence character

Boolen

Methods For String

split(): helps to divide  string valuse base on argument provided

Strings

Example: "Pokemon", "pikachu_1", "369",

'charmander', 'b002saur', '401',

we can perform concatenation, repeatation, indexing,

Float

Decimal number are called as float values

E.G. 0.625,  10.5,  10101110.01101,

In-Built Function

Functions that already defined by creator of python

There are more than 60 pre-defined function.

  1. dict() - Creates a dictionary.
  2. float() - Converts a value to a floating-point number.
  3. id()- Returns memory location id
  4. input() - Reads a line of input from the user.
  5. list() - Creates a list.
  6. len() -  Returns the length of argument
  7. max()- Returns the maximum value from the list
  8. print() - Prints to the standard output device.
  9. range() - Returns a sequence of numbers.
  10. reversed() - Returns a reversed iterator.
  11. round()- Returns nearest whole number. 
  12. set() - Creates a set.
  13. str() - Converts a value to a string
  14. title()- convert into Title Case
  15. tuple() - Creates a tuple.
  16. type() - Returns the type of an object.

Data Type

to check data type of variable X

print(type(X))

Methods for list

Nested List:

Screenshot 2024-09-30 075341

.append():add element at the end

.count(): return the number of provided element

.insert(): add new element at provided index

.pop():remove the ele of given index

.reverse(): reverse the arrangement order

.remove(): remove first occured ele i.e. provided

.sort(): rearrange the elements in assending order

String

it has list of letters, ni=umbers, and symbols too

List

Libarary

Tuple

Methods

.count() return the number of given ele

.index(): return the index of given ele

Random

Screenshot 2024-09-30 070227

Set

Methods

.add(): its same like append for list

.clear(): delete all ele and makes empty set

.discard(): delete if ele is member

.remove(): delete provided ele

.pop(): delete and return random ele

del set(): delet the exixtence of given set

set1.union(set2)  or  set1|set2

set1.intersection(set2)  set1 & set2

set1.difference(set2)  set1-set2

set1.symmetric_difference(set2)  set1^set2

set1.symmetric_difference_update(set1)

set1.issubset(set2)    set1<=set2

set1.issupperset(set2)    set1>=set2

Statastices

Can be used to find mean, median mode and analyse data more