Posts

Set blog surya

Image
PYTHON PROGRAMMING      SET  SET: Set are used to store multiple items in a single variable. sets are written with curly brackets. EXAMPLE: a={"apple","banana","cherry"} print(a) SET METHOD: 1.UNION()        Return a set cotaining the union of sets. EXAMPLE: 2.INTERSECTION()             Return a set,that is the intersection of two or more sets. EXAMPLE: 3.DIFFERENCE()           Returns a set containing the difference between two or more sets. EXAMPLE 4.CLEAR()      Remove all the elementsfrom the set. EXAMPLE 5.DIFFERENCE_UPDATE()                      Remove the items in this set that are also included in another specified set. 6.INDERSECTION_UPDATE()                    Remove the items in this set that are not present in other, specified sets. EXAMPLE 7.ISDISJOINT()   ...

tuple suryapriya

Image
  PYTHON    PROGRAMMING   TUPLE TUPLE:       1 . Tuple  is a collection of data  which  separated by commas.     2 .Tuples  are  immutable.     EXAMPLE:        a=(1,2,3,'hello',34.2) TUPLES METHOD:       1.INDEX ( ):                index () method searches for the given element in a  tuple  and returns its position. It returns first occurrence of the element in the  tuple .  Index  starts from 0 and end at n-1. where n is length of  tuple             EXAMPLE: 2.COUNT ( ):              count () method  counts  the occurrence of an element in the  tuple . It required a parameter which is to be counted. If the item is missing in the  tuple , it simply returns 0.             EXAMPLE:

dictionary blog surya

Image
    PYTHON PROGRAMMING - DICTIONARY   DICTIONARY:           1   . Dictionary is an unordered sequence of data of key-value pair form.        2. Dictionaries are written within curly braces in the form key:value.        3. It is very useful to retrieve data in an optimized way among a large amount of data. EXAMPLE:           a = {'name':'Meera', 'gender':'Female', 'dept':'EEE' }          print(a['name']) DICTIONARY METHODS:         1.CLEAR( ):                     The clear( ) method removes all items from the dictionary. This method doesn't return any value. The clear( ) method doesn't take any parameters.           SYNTAX:  dict.clear( )  EXAMPLE: 2. COPY( ):                         ...

PYTHON LIST

  LIST:        1.   Lists  are used to store multiple items in a single variable.           2.It  is mutable. this means that once defined ,they can be changed.         3.List is the most versatile data-type available in Python that can be written as a collection of comma-separated values or items between square brackets.        4.A single list can contain different Data-Types such as integers ,strings ,as well as objects .    Example:  A=[23,'Hello,23.4,'y''] LIST  OPERATORS:           1. '+'  OPERATOR  FOR  CONCATENATION:                  Concatenation  of  lists  is an operation where the elements of one  list  are added at the end of another  list .  EXAMPLE: >>>a=[1,2,3] >>>b=[4,5,6] >>>a+b [1,2,3,4,5,6] ...