147k views
1 vote
Statement1 : Lists are used to store multiple values in a single variable.

Statement2 : We can access the values in an lists by using an index number.

Both statements are True.

Question 7 options:
True
False

User Kayyagari
by
7.1k points

1 Answer

5 votes

Answer:

Both statements are true.

Step-by-step explanation:

1) Lists are used to store multiple values in a single variable.

- Lists in programming languages, such as Python, allow you to store multiple values in a single variable. Each value within the list is separated by a comma and enclosed in square brackets []. For example, [1, 2, 3] is a list that contains three values.

2) We can access the values in a list by using an index number.

- Lists are ordered collections, and each element in a list has an index number associated with it. Indexing in most programming languages starts from 0. For example, if we have a list [10, 20, 30], the element 10 is at index 0, the element 20 is at index 1, and the element 30 is at index 2. To access a specific element in a list, you can use its index. For instance, `my_list[1]` would retrieve the value 20 from the list.

By combining these two statements, we can conclude that lists are indeed used to store multiple values in a single variable, and we can access the values in a list using an index number.

Therefore, the correct option is True.

User Marvia
by
7.0k points