Program Console Vignaankosh.com
Execution Panel
Console is empty.
Sort list in descending order is an interactive PYTHON dry run visualizer from the Lists 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.
# Sort list in descending order
nums = [3, 7, 1, 9, 4, 6, 2, 8]
print("Original:", nums)
# Method 1: sort(reverse=True)
nums.sort(reverse=True)
print("After sort(reverse=True):", nums)
# Method 2: sorted() with reverse
nums2 = [3, 7, 1, 9, 4, 6, 2, 8]
desc = sorted(nums2, reverse=True)
print("Using sorted(..., reverse=True):", desc)