Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.74 KB

File metadata and controls

69 lines (53 loc) · 1.74 KB
			PYTHON CODING FORMATS

#INTRODUCTION:

	PYTHON IS A..
	* HIGH LEVEL PROGRAMMING LANG
	* OBJECT ORIENTD PRO LANG
	* STRICTLY TYPED LANG
	* GUI PRO LANG                           //u can design gui using python
	* INTERPRETED LANG                       //executes the code line by line
	* PORTABLE OR PLATFORM INDEPENDENT LANG  //means the code can run any os.

#NUMERIC DATA TYPES:

IN PYTHON DATA TYPES ARE USED INCLUSIVELY
* INTEGER
* LONG INT
* FLOAT
* COMPLEX

#ARTHIMATIC & LOGICAL OPERATORS

* a+b, a-b, a*b, a/b, a%b,a//b
  a**b==pow(), divmod()
* >, <, >>, <<, !=, <>
* &, |, ~, ^
-----------
* and == &
* or == |
* not == ~
* in, not in == USED TO MEMBERSHIP TESTS
* is, not is == USED TO IDENTITY TESTS
* a[INDEX]== SUBSCRIPTION
* a[INDEX:INDEX] == SLICEING

#TOUPLES && LISTS

1. LIST IS
		* a container which holds comma separated values (items or elements)
		  between square brackets where values need not all have the same type.
		* we can define a list as an object 
		  that obj contains multiple data values.
		* size and values can also be change during execution.we can add or remove values.
		* dynamic array/sequence
		* mutable
		* indexable
		* lists are 3 tpyes
			1. HETEROGENEOUS
			2. INDEXABLE
			3. DYNAMIC
		* we can add to a list to make longer.
		
	Syntax: [],list()range() and xrange():
	
	range(n)=creates list of n integers
	xrange(n)= creates list of integers and creats an iterator.
	to find length of touple/list= len(x)

2. TOUPLE IS
		* same as like lists but u cannot change its values once created 
		* and can hold mix data types.
		* sequence
		* immutable
		* same like lists but immutable.