mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-20 12:47:35 +00:00
"Rename variable 'nodeData' to 'node_data' in main function"
This commit is contained in:
parent
a3becf3100
commit
041da89cab
@ -354,16 +354,16 @@ if __name__ == "__main__":
|
|||||||
choice = input("Enter your choice: ")
|
choice = input("Enter your choice: ")
|
||||||
|
|
||||||
if choice == "1":
|
if choice == "1":
|
||||||
nodeData = int(input("Enter a number: "))
|
node_data = int(input("Enter a number: "))
|
||||||
linked_list.insert(nodeData)
|
linked_list.insert(node_data)
|
||||||
elif choice == "2":
|
elif choice == "2":
|
||||||
linked_list.display()
|
linked_list.display()
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
nodeData = int(input("Enter the data to delete: "))
|
node_data = int(input("Enter the data to delete: "))
|
||||||
if linked_list.delete(nodeData):
|
if linked_list.delete(node_data):
|
||||||
print(f"Node with data {nodeData} deleted successfully")
|
print(f"Node with data {node_data} deleted successfully")
|
||||||
else:
|
else:
|
||||||
print(f"Node with data {nodeData} not found in the list")
|
print(f"Node with data {node_data} not found in the list")
|
||||||
elif choice == "4":
|
elif choice == "4":
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user