Posts

Showing posts from June, 2021

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] ...

python string

PYTHON STRING: A   String is  a  sequence  of  characters. A  characters  simply a symbol. For example ,the English language has 26 characters. ...In python ,a string is a sequence of Unicode characters. Unicode was introduced to include every character in all language and bring uniformity in encoding. Built-in string Function in Python  lower()- Converts all the characters of string to lowercase          ex: var='HI PYTHON'          print(var.lower())         #hi python  upper()- Converts all the characters of the string to uppercase          ex:var='hello python'         print(var.upper())         #HELLO PYTHON title()- Return the 'titlecased' version of string ,which means that all words strat with uppercase and the rest of the characters in words are in lowercase. ex:a='welcome python' print(a.title()...