from noeud import Node 

class ListSimple :
	def __init__(self):
		self.first = None

	def ajouter_debut(self,value) :
		if self.first == None :
			self.first = Node(value)
		else : 
			n = Node(value)
			n.next = self.first
			self.first = n

	def ajouter_fin(self, value) :
		if self.first == None :
			self.first = Node(value)
		else : 
			n = self.first
			while n.next != None :
				n = n.next
			n.next = Node(value)

	def retirer_debut(self) :
		if self.first != None :
			self.first = self.first.next

	def retirer_fin(self) :
		if self.first != None :
			n = self.first
			while n.next.next != None :
				n = n.next
			n.next = None

	def parcours(self):
		if self.first is None:
			print("Pas d'élément dans la liste")
		else:
			n = self.first
			while n is not None:
				print(n.value , " ", end='')
				n = n.next
			print()
