Display all values of dictionary Dry Run in PYTHON

Display all values of dictionary is an interactive PYTHON dry run visualizer from the Dict 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.

Display all values of dictionary Program Code

# Display all values in dictionary
product = {
    "name": "Laptop",
    "brand": "Dell",
    "price": 899.99,
    "stock": 15,
    "rating": 4.5
}
print("Dictionary:", product)

# Method 1: Using values() method
values_view = product.values()
print(f"\nUsing values(): {values_view}")
print(f"Type: {type(values_view)}")

# Method 2: Convert to list
values_list = list(product.values())
print(f"As list: {values_list}")

# Method 3: Iterate over values
print("\nValues one by one:")
for value in product.values():
    print(f"  {value}")

# Method 4: Get unique values
unique_values = list(dict.fromkeys(product.values()))
print(f"\nUnique values: {unique_values}")

View the complete Dict programs page.

Program Console Display all values of dictionary Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.