lapply is used to show the output in the form of list whereas sapply is used to show the output in the form of vector or data frame