forked from jwasham/practice-python
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
33 lines (28 loc) · 688 Bytes
/
main.py
File metadata and controls
33 lines (28 loc) · 688 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
from linked_list import LinkedList
# from node import Node
def main():
ll = LinkedList()
print("Initial size: ", len(ll))
ll.push(24)
print("New size: ", len(ll))
print("List content: ", ll)
print("Pushing more")
ll.push(6)
ll.push(783)
print("List content: ", ll)
print("popping...")
ll.pop()
print("List content: ", ll)
print("Does list contain 24?")
if ll.contains(24):
print("Yes")
else:
print("No")
print("Deleting 24")
ll.delete(24)
print("List content: ", ll)
print("Pushing another onto end.")
ll.append(365)
print("List content: ", ll)
if __name__ == "__main__":
main()