From 137871bfef005f8c53d9c2f20cc8ba7b5d944eeb Mon Sep 17 00:00:00 2001 From: rohan11074 <34051577+rohan11074@users.noreply.github.com> Date: Sun, 7 Apr 2019 21:25:32 +0530 Subject: [PATCH] feature to add input (#749) --- .../linked_list/singly_linked_list.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/data_structures/linked_list/singly_linked_list.py b/data_structures/linked_list/singly_linked_list.py index 0b9e44768..5ae97523b 100644 --- a/data_structures/linked_list/singly_linked_list.py +++ b/data_structures/linked_list/singly_linked_list.py @@ -70,16 +70,20 @@ class Linked_List: def main(): A = Linked_List() - print("Inserting 10 at Head") - A.insert_head(10) - print("Inserting 0 at Head") - A.insert_head(0) + print("Inserting 1st at Head") + a1=input() + A.insert_head(a1) + print("Inserting 2nd at Head") + a2=input() + A.insert_head(a2) print("\nPrint List : ") A.printList() - print("\nInserting 100 at Tail") - A.insert_tail(100) - print("Inserting 1000 at Tail") - A.insert_tail(1000) + print("\nInserting 1st at Tail") + a3=input() + A.insert_tail(a3) + print("Inserting 2nd at Tail") + a4=input() + A.insert_tail(a4) print("\nPrint List : ") A.printList() print("\nDelete Head")