-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlists.py
48 lines (36 loc) · 829 Bytes
/
lists.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
# Lists 1
print("=========================")
print("Lists 1st")
print("=========================")
friends = ["Adi" , "Dedi" , "Budi"]
print(friends)
print(friends[0])
print(friends[1])
print(friends[2])
print(len(friends))
friends.append("Rudi")
print(friends)
print("=========================")
# Lists 2
print("=========================")
print("Lists 2nd")
print("=========================")
friends = [
["Bob" , 27],
["Anne" , 28],
["Rudi" , 29]
]
print(friends[0][0])
print(friends[0][1])
print(friends[0])
print("=========================")
# Lists 3
print("=========================")
print("Lists 3rd")
print("=========================")
friends = ["Bob", "Anne" , "Rudi"]
add1 = input("Enter Name : ")
friends.append(add1)
print(friends)
print("=========================")