Dynamic generation of Named Tuple class

# Introduction In this challenge, we will implement a function in Python that dynamically generates a Named Tuple class. The function will take a typename and field_names as parameters, allowing us to generate a class with specific aliases for accessing internal elements. We will use runtime code generation and execution to achieve this task. The dynamically generated Named Tuple class should support accessing data through both positional indexing and alias attributes, and the repr output format should resemble "Point(x=1, y=2)". The implementation cannot use any related names from the Python standard library and cannot contain the keyword "namedtuple". We will validate the solution using a set of unit tests.

|
60 : 00

Click the virtual machine below to start practicing