Computer Science, asked by srishtigupta26, 5 months ago

Which of the following is True regarding lists in Python?
A. Lists are immutable.
B. Size of the lists must be specified before its initialization
C. Elements of lists are stored in contagious memory location.
D. size(list1) command is used to find the size of lists​

Answers

Answered by Jaishree123
9

Explanation:

Elements of lists are stored in contagious memory location is the true regarding lists in Python.

Hope it helps you

Answered by letmeanswer12
1

"  C) Elements of lists are stored in contiguous memory location "

Explanation:

Option A) Most python objects (booleans, integers, floats, strings, and tuples) are immutable which means that after you create the object and assign some value to it, we can't modify that value.

Option B) We can initialize a list of size n using a range() statement

The difference between using a range() statement and there is no method is that a range() statement will create a list of values between 2 numbers by default, range() creates a list from 0 to a particular value.

Option D) size (list 1) command is used to find the size of lists. Python has got inbuilt method - len() to find the size of the list that is the length of the list. The len() method accepts an iterable as an argument and it counts, returns the number of elements present in the list.

For the implementation of a list a contiguous array of references to other objects is used in it

Python holds a pointer to this array and the array's length is stored in a list head structure

So, This is true regarding lists in python

Similar questions