-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThirteen Day.py
More file actions
59 lines (36 loc) · 922 Bytes
/
Thirteen Day.py
File metadata and controls
59 lines (36 loc) · 922 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ____________________ Thirteenth _____________________ #
# The lists in Python are wirtten with [ ]
s = []
print(s)
numbers = [1,2,3,4,5]
print(numbers)
lists =["apple","banan","cherry"]
print(lists)
thelist = ["apple","banana","cherry",1,2,3]
print(thelist)
print("\n")
# access the list items by referring to the index number
lists =["apple","banan","cherry"]
print(lists[1])
print("\n")
# Using for loop
lists =["apple","banan","cherry"]
print("using for loop :")
for x in lists:
print(x)
print("\n","change the second wird in the lisis:")
lists =["apple","banan","cherry"]
lists[1]="orange"
print(lists)
# delete the first word in the lists
lists =["apple","banan","cherry"]
del lists[0]
print(lists)
# delete the all word in the lists
lists =["apple","banan","cherry"]
# del lists will delete the lists
lists = ["A","B","C","D","E"]
print(lists)
del lists[0]
del lists[1]
print(lists)