Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What are the lists,tuples in python and how are they different from arrays of C..?

user-image
Question added by Abdul Khader Shaik , IT & Ops Manager , TheSmartlabs
Date Posted: 2018/02/21
NASSER AL-OSTATH
by NASSER AL-OSTATH , Co-Founder , www.pythonat.com

lists are like arrays in C .

tuples are lists but you cannot modify them ( adding, taking off elements )

 

but one of the strong features of python's data structures is dictionaries where you can have something like a list and it's elements are keys and values and looks like this :

my_dict ={'key1':value1 , 'key2':value2 ..... } where you can think of the key as a definition and the value is the explanation of that definition , just like a real dictionary. 

 

or

 

keys are variables and values are whatever you set them to be for each key.

More Questions Like This