namedtuple to Dictionary Dry Run in PYTHON

namedtuple to Dictionary is an interactive PYTHON dry run visualizer from the Collection programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

namedtuple to Dictionary Program Code

from collections import namedtuple

Student = namedtuple("Student", ["roll", "name", "marks"])
s1 = Student(101, "Meena", 86)

print(s1)
print(s1._asdict())

View the complete Collection programs page.

Program Console namedtuple to Dictionary Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.