-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist.py
32 lines (25 loc) · 1013 Bytes
/
list.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
we can store one value to a varible.
but what if we need to store multi data to a sigle variable,further more - more data with different dataypes to a single varibale.
It can be done ny the concept of the list.
We can store multi type of data to a single variable by making a list.
list can also store the duplicates.
list items are ordered so there will be concept of indexing.
"""
# list means thers is a list that consist datas.
# it is a similar concept like array in c.
"""
syntax---
var_name = [value 1 of data type1,value 2 of data type 2]
"""
"""
To access a particular member the indexing concept is same as array.
"""
"""
Array Vs List---
array stores same datatype where list can store multitype of data.
"""
# list us mutable. mutable means you can perform some actiones on the list.
# like addind a member,deleting a member , changing a value of member , finding a number.
list_=[1,2,3,4]
print(f"{list_}") # you can also write print(list_) see the o/p , not that it comes with .