Page 132 - Code_GPT_Class_8
P. 132
Yes, I understood. List is a built-in Good! Let me see your program.
data type used to store a collection of
data. I have done the task already.
Test Your Knowledge 21 st Century #Critical Thinking
Skills
#Technology Literacy
Identify and circle the strings in Python from the following:
1. "Name" 2. 'Delhi'
3. 123 4. 23234.54
5. "22323.11" 6. '*&%$#'
A list is a sequence of multiple values in a specific order. In a list, each element or value is called an
item. A list is mutable, which means the items in a list can be modified by assigning new values. It
is heterogeneous in nature, which means a list can contain numeric as well as textual data. In this
chapter, you will learn about creating a list, operations performed on the list and the functions of
the list.
CREATING A LIST
Python uses lists to store different kinds of data in specific order. Because Python lists are changeable
types, we can change their elements after they’ve been generated.
To create a list, you need to place all the elements separated by a comma inside a square bracket [ ].
The list can contain any number of elements of different data types such as integer, float, character
and so on.
Syntax to Create a List:
Factbot
<list_name> = [value1, value 2, value 3, ...]
Homogeneous elements are of same data types
Heterogeneous elements are of different data types
CodeGPT (Ver. 4.0)-VIII
130

