





class      A_	:
	def __init__(   self							, _A		):






				'''simple docstring'''







				UpperCAmelCase       		=    data
				UpperCAmelCase       		=    None
				UpperCAmelCase       		=    None







	def __str__(   self		):






				'''simple docstring'''







				return F"""{self.data}"""

class      A_	:
	def __init__(   self		):






				'''simple docstring'''







				UpperCAmelCase       		=    None
				UpperCAmelCase       		=    None
	def __iter__(   self		):






				'''simple docstring'''







				UpperCAmelCase       		=    self.head
				while node:
							yield node.data
							UpperCAmelCase       		=    node.next
	def __str__(   self		):






				'''simple docstring'''







				return "->".join([str(_A		) for item in self]		)
	def __len__(   self		):






				'''simple docstring'''







				return sum(1 for _ in self		)
	def 					_lowercase    (   self							, _A		):






				'''simple docstring'''







				self.insert_at_nth(0							, _A		)
	def 					_lowercase    (   self							, _A		):






				'''simple docstring'''







				self.insert_at_nth(len(self		)							, _A		)
	def 					_lowercase    (   self							, _A							, _A		):






				'''simple docstring'''







				UpperCAmelCase       		=    len(self		)

				if not 0 <= index <= length:
							raise IndexError('''list index out of range'''		)
				UpperCAmelCase       		=    Node(_A		)
				if self.head is None:
							UpperCAmelCase       		=    UpperCAmelCase       		=    new_node
				elif index == 0:
							UpperCAmelCase       		=    new_node
							UpperCAmelCase       		=    self.head
							UpperCAmelCase       		=    new_node
				elif index == length:
							UpperCAmelCase       		=    new_node
							UpperCAmelCase       		=    self.tail
							UpperCAmelCase       		=    new_node
				else:
							UpperCAmelCase       		=    self.head
							for _ in range(0							, _A		):
										UpperCAmelCase       		=    temp.next
							UpperCAmelCase       		=    new_node
							UpperCAmelCase       		=    temp.previous
							UpperCAmelCase       		=    temp
							UpperCAmelCase       		=    new_node
	def 					_lowercase    (   self		):






				'''simple docstring'''







				return self.delete_at_nth(0		)
	def 					_lowercase    (   self		):






				'''simple docstring'''







				return self.delete_at_nth(len(self		) - 1		)
	def 					_lowercase    (   self							, _A		):






				'''simple docstring'''







				UpperCAmelCase       		=    len(self		)

				if not 0 <= index <= length - 1:
							raise IndexError('''list index out of range'''		)
				UpperCAmelCase       		=    self.head  # default first node
				if length == 1:
							UpperCAmelCase       		=    UpperCAmelCase       		=    None
				elif index == 0:
							UpperCAmelCase       		=    self.head.next
							UpperCAmelCase       		=    None
				elif index == length - 1:
							UpperCAmelCase       		=    self.tail
							UpperCAmelCase       		=    self.tail.previous
							UpperCAmelCase       		=    None
				else:
							UpperCAmelCase       		=    self.head
							for _ in range(0							, _A		):
										UpperCAmelCase       		=    temp.next
							UpperCAmelCase       		=    temp
							UpperCAmelCase       		=    temp.previous
							UpperCAmelCase       		=    temp.next
				return delete_node.data
	def 					_lowercase    (   self							, _A		):






				'''simple docstring'''







				UpperCAmelCase       		=    self.head

				while current.data != data:  # Find the position to delete
							if current.next:
										UpperCAmelCase       		=    current.next
							else:  # We have reached the end an no value matches
										raise ValueError('''No data matching given value'''		)

				if current == self.head:
							self.delete_head()

				elif current == self.tail:
							self.delete_tail()

				else:  # Before: 1 <--> 2(current) <--> 3
							UpperCAmelCase       		=    current.next  # 1 --> 3
							UpperCAmelCase       		=    current.previous  # 1 <--> 3
				return data







	def 					_lowercase    (   self		):






				'''simple docstring'''







				return len(self		) == 0





def 						__SCREAMING_SNAKE_CASE  (    )  ->    None:







			'''simple docstring'''

			UpperCAmelCase       		=    DoublyLinkedList()
			assert linked_list.is_empty() is True
			assert str(UpperCamelCase__			) == ""

			try:
						linked_list.delete_head()
						raise AssertionError  # This should not happen.
			except IndexError:
						assert True  # This should happen.

			try:
						linked_list.delete_tail()
						raise AssertionError  # This should not happen.
			except IndexError:
						assert True  # This should happen.

			for i in range(10			):
						assert len(UpperCamelCase__			) == i
						linked_list.insert_at_nth(UpperCamelCase__      ,      i + 1			)
			assert str(UpperCamelCase__			) == "->".join(str(UpperCamelCase__			) for i in range(1      ,      11			)			)

			linked_list.insert_at_head(0			)
			linked_list.insert_at_tail(11			)
			assert str(UpperCamelCase__			) == "->".join(str(UpperCamelCase__			) for i in range(0      ,      12			)			)

			assert linked_list.delete_head() == 0
			assert linked_list.delete_at_nth(9			) == 10
			assert linked_list.delete_tail() == 11
			assert len(UpperCamelCase__			) == 9
			assert str(UpperCamelCase__			) == "->".join(str(UpperCamelCase__			) for i in range(1      ,      10			)			)


if __name__ == "__main__":
						from doctest import testmod

						testmod()










def 						__SCREAMING_SNAKE_CASE  (    UpperCamelCase__      ,      UpperCamelCase__      ,      UpperCamelCase__			)  ->    float:







			'''simple docstring'''

			if mass < 0:
						raise ValueError('''The mass of the body cannot be negative'''			)
			if radius <= 0:
						raise ValueError('''The radius is always a positive non zero integer'''			)
			return (mass * (velocity) ** 2) / radius


if __name__ == "__main__":
				import doctest

				doctest.testmod(verbose=True)



