Sequence in Python
A sequence in python is a linearly ordered set of elements accessed by an index number.
Sequence are useful when we want to work with collection of values.
Basically there are 4 types :
1.)List
2.)Tuple
3.)String
4.)Dictionary
2.)Tuple
3.)String
1.) List :
It is a linear data structure where data structure means organization of data. These means in a list the element are ordered linearly i.e there is a 1st element, 2nd element & so on, given an element we can talk about its previous element & next element.
eg : ['Apple','Mango','Grapes','Banana']
Hey guys want to see an video regarding List?... Do check out this video which will help you to clear all your questions with live examples.
2.) Tuple :
A tuple is a sequence of immutable Python objects. Tuples are just like lists with lists with the exception that the tuple cannot be once declared. Tuple are usually faster than list.
eg : ('Apple','Mango','Grapes','Banana')
Hey guys want to see an video regarding Tuples?... Do check out this video which will help you to clear all your questions with live examples.
3.) String :
A String is a sequence of characters. It can be declared in python by using double quotes. Strings are immutable which means they cannot be changed.
eg : "Hello World"
Hey guys want to see an video regarding Strings?... Do check out this video which will help you to clear all your questions with live examples.
4.) Dictionary :
Dictionary in Python is an unordered collection of data values, used to store data values like a map, which unlike other Data Types that hold only single value as an element, Dictionary holds key:value pair. Key value is provided in the dictionary to make it more optimized.
eg : " {'name':'bob','age':19}
Hey guys want to see an video regarding Dictionary?... Do check out this video which will help you to clear all your questions with live examples.
This is all the basics which we need to start our data science journey.
The advance concepts about this such as Indexing, Slicing etc will be covered at topic Numpy so stay tuned.
Hey guys do you enjoying our content?....Please do comment below.
No comments:
No Spamming and No Offensive Language