

from collections.abc import Callable

import numpy as np

def 						UpperCamelCase (lowercase_:			Callable   ,				lowercase_:			float   ,				lowercase_:			float   ,				lowercase_:			float   ,				lowercase_:			float )					->				Optional[int]:
	A__							:   int					       =		int(np.ceil((x_end - xa) / step_size ) )
	A__							:   List[Any]					       =		np.zeros((n + 1,) )
	A__							:   Any					       =		ya
	A__							:   Optional[Any]					       =		xa

	for k in range(__a ):
		A__							:   Optional[Any]					       =		y[k] + step_size * ode_func(__a   ,				y[k] )
		A__							:   List[str]					       =		y[k] + (
		    (step_size / 2) * (ode_func(__a   ,				y[k] ) + ode_func(x + step_size   ,				__a ))
		)
		x += step_size

	return y


if __name__ == "__main__":
		import doctest

		doctest.testmod()






from __future__ import annotations

def 						UpperCamelCase (lowercase_:			float   ,				lowercase_:			float   ,				lowercase_:			float )					->				dict[str, float]:
	if (voltage, current, resistance).count(0 ) != 1:
		raise ValueError("""One and only one argument must be 0""" )
	if resistance < 0:
		raise ValueError("""Resistance cannot be negative""" )
	if voltage == 0:
		return {"voltage": float(current * resistance )}
	elif current == 0:
		return {"current": voltage / resistance}
	elif resistance == 0:
		return {"resistance": voltage / current}
	else:
		raise ValueError("""Exactly one argument must be 0""" )


if __name__ == "__main__":
	import doctest

	doctest.testmod()



