basic functions:-
===============
==>type(data)--it is a function used to find the data type of a data in a variable.
==>len(string)--it is a function used to get the length of string or collections
==> del -- it is a keyword in python used to delete data from memory ex:- del
list1.
==>input("message")--it is a function used to the user [Link] return type is
always string.
==>type casting:-converting one type of data to another type of data
-->int("int value")--used to convert the string of int value to int.
-->float("float value")--used to convert the string of float value to float.
-->bool("bool value")--used to convert the string of bool value to bool.
data Strucures:-
===============
[Link]:-
-------
--> it can caontain hetregeneous
--> indexed /ordered
--> allows negative index
--> mutable
--> allow duplicates
--> [] are used to create list
--> methods -len(list_name),pop(index)-delete the index item,remove(value/item)-
delete the given item(first occurred) , [Link](item)-to add item at last of
list
[Link](index,item)-add the item at given index.
--> slice-- list[start_ind:end_position], list[:]-gives full list,list[st_ind:]-
give items from given st_index to end of list, list[:end_ind]-gives from starting
index to given end_index.
--> [Link]()-- used to clear the all items in list.
[Link]:-
------------
--> it contains only homogeneous elements
--> immutable
--> it allows duplicates.
--> allows indexing
--> () are used to create tuple.
--> to create single itemvtuple , is [Link]:- t1=("lokesh",)
[Link]:-
-----------------
--> hetregenous
--> {} are used to create dictionary.
--> stores data in key:value pair
--> duplicate keys are not allowed but values allowed.
--> keys are used to access the values/there is no indexing.
--> mutable
--> create dictionary :-
dict1={"name":"lokesh","age":20,"pass":True,False:"zero",30:"hero"}
--> keys must be String,int,float,bool,Tuple
--> values can be anything..
--> [Link]()-returns the list of all keys,[Link]()-return the list
of all values,[Link]()-returns all key value pairs in the form of Tuple.
--> access :- print(dict["name"]) o/p:- "lokesh"
--> re-assign :- dict1["age"]=22
print(dict1["age"]) o/p :- 22
ex:- for key in [Link]():
print(key,dict1[key],sep=" : ")
--> remove item -- [Link]("name")
-- del dict1["age"]
--> [Link]()-- used to clear the all items in dictionary.
[Link] :-
---------
--> Heterogenous element.
--> Unordered
--> immutable / but able to add new items
--> {} are used to create set
--> doesn't duplicates
--> to create empty set ex:- s1= set()
--> functions -- [Link]()-used to add the items to set.
--> [Link](set2) -- this add the set2 items in set1.
--> [Link](set2) -- this generates and return new set with the elements in both
sets(old sets are not updated).
--> [Link](s2) -- returns the commom items in both sets
--> set1.symmetric_difference(set2) -- returns the not common items
set1={"lokesh",143,"heroine",True}
for item in set1:
print(item)