 Hello everyone, my name is Nikhil Gadjam, working as assistant professor in department of computer science and engineering in Valchand instead of technology, Solapur. In today's session we will see some inbuilt functions in Python, those are type, id and length. So, learning outcome at the end of this session, student will be able to write a program using type id length function in Python. So, first function we will see is type. So, type function is used to get the type of an object. When a single argument is passed to this type function, it returns the type of an object. We will see the example in PyCharm. Suppose I will declare one value, suppose this is num1 equal to 10. Suppose you print this print, generally how you are printing value of num1? It will be num1, okay? So, it will print the value of num1 generally. So, it will print n. Suppose instead of printing the value, if you print type of num1, if you check the output, in that case it is printing num1 is of type integer. So, as we know data type is not there in Python, automatically a type is assigned during execution of the program in Python. So, by default a num1 will store value 10. So, value 10 is generally integer value. So, automatically a type of num1 will be an integer value, okay? Now, suppose if you declare num s1 equal to, suppose this is valchen and if you write the type of s1 and if you execute this, it will print type str, so valchen is string by default. When anything you enclose that in double quotes, that will be a string in Python. So, s1 is actually a string and when you print type of s1, it will print type str. Similarly, a list will be there, suppose this is l1 equal to, suppose this is 10, 2.5, another list suppose 1, 2, 3, then next one is valchen and if you print this type of l1, if you execute this, so it is printing type list. So, type of l1 is a list and it will contain 1, 2, 3, 4 and 5 values. Suppose if you write type of l1 of 0, 1, 0, 1, 2, 3, if you write type of l1 of 3, so it should print type str, so l1 of 3, so l1 of 1, l1 of 0 is 10 value which is integer l1 of 1 is 2.5 which is actually a double value, l1 of 2 it is a list and l1 of 3 is actually a string. You can write inside for loop also for each element in l1 and then again next time inside for loop you print type of element and if you execute this, so it is printing first value is actually integer value, next value is float value, next value is list value, list inside list and last value is str. So, this is type function which will print a type of object you pass to that function. We move forward now, this is an example for type function, you have already seen list is equal to 4, 5 and then print type of list it will print type or class list. Then dictionary it is dictionary with key as 4 and value as 4 and next is key value fair is 5 is a key and 5 is a value, if you print type of dictionary DICT it will print type DICT like this, class DICT, so type function is used to print the type of an object. Next function is id function, id is a ill bit function in python, the id function returns the unique id for specific object, the id is objects memory address and which will be different for each time when you execute the program, all objects in the python has its own unique id, this id is assigned to the each object whenever it is created. So, whenever variables you declared in your python program memory is generally allocated to that variable, each value each variable in python has its own unique id. To print that id, we are using id function and this id function will be having value, different value every time when you run a program every time, so if you will try this program, suppose I will write num1 equal to or a equal to suppose 10 and if you print, this is id of a, if you execute this, it is printing one value, which is actually object id of a, it will be 39, 4, 11, 9, 0, 4, something like that, so next time a different value printed because next time memory allocation will be different, id of that a will be different that is why it is printing a different value. Suppose you declare another variable b equal to suppose solapur and if you print id of b and if you execute this, it is printing a different id for a, different id for b, so id function is used for printing id of a particular variable. This is an example, suppose b equal to 10, c equal to 11, d equal to 12, print id of b, id of c and id of d, so it will print some different value and this is interesting question, you can pause the video and you can answer the video, answer the question in the following program whether id of a and id of b will be same value or different value, program is a equal to 10, b equal to 10, print id of a and print id of b, you can pause the video and you can answer. Answer is both this print statement for printing id of a and id of b, though both this print statement will print the same value. This is a different for python and in java, in python when variables are having same value, in that case a different memory is not allocated for b in this case, b is again pointing to a same memory location where a is pointing. This is a uniqueness in python, we will try out this program, suppose a equal to 10 and b equal to 10 again, print id of a and id of b, if you execute this program, so it is printing the same value, initially value of a is 10, a memory is allocated for a and a has its own unique id, when you write b equal to 10, in that case a different memory is not allocated for b, both a and b both are pointing to same memory location. So, that is why id of a and id of b both are having same value, same id's. Next third function is alien function or length function, so length is a inbuilt function in python, you can use alien to get a length of given string or given array list or given tuple or given dictionary, generally alien function is used to find out how many elements are present in the given value or given variable, you can use alien function to optimize the performance of a program, the number of elements stored in the object is never calculated, so alien helps provide the number of elements present in the variable. Suppose str1 is equal to hello solapur, print the length of the string is alien str1, length of str1, list 1 equal to 4 values are there, then print length of list is alien list 1, we will try out this program. Suppose I will declare one string str equal to suppose valchan and I am printing print this is alien of s and if you execute this, so it is printing length of s or how many characters which are present in the s, suppose I am declaring one list, list 1 equal to 1, 2, 3, 4, 5 and I am printing alien of this is list 1, if you execute this, so it is printing 5, so alien function is used to find out how many elements are present in list or how many characters are present in string, something like that, so alien function is very useful generally. Next one, alien function is generally used in a loop, for loop or while loop, how it is used? We will see, I will declare one list, suppose this is a list and I want to print each and every element in list 1, so how it is used, alien function is used in for loop is for i in range 0, alien of list 1, then next one is print list 1 of, just a second, so it is printing all the elements of list 1, so alien function I have used inside the for loop, so instead of counting how many elements are there in list 1, I have used alien function, so automatically it will count the length of list 1 and for loop will be executed, so these are the references I have used for creation of this video. Thank you.