From f2e6b850afcf6c59c08ed458bde74a44888cdad5 Mon Sep 17 00:00:00 2001 From: b-suryaraj <91749712+b-suryaraj@users.noreply.github.com> Date: Sat, 2 Oct 2021 08:08:05 +0530 Subject: [PATCH] Create linked_list.py --- Python/linked_list.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Python/linked_list.py diff --git a/Python/linked_list.py b/Python/linked_list.py new file mode 100644 index 000000000..c785fbc73 --- /dev/null +++ b/Python/linked_list.py @@ -0,0 +1,17 @@ +class Node: + def __init__(self, data=None): + self.data = data + self.next = None + +class LnkdList: + def __init__(self): + self.head = None + +l1 = LnkdList() +l1.head = Node("Mon") +e2 = Node("Tue") +e3 = Node("Wed") +# Link first Node to second node +l1.head.next = e2 +# Link second Node to third node +e2.next = e3