Program Console Vignaankosh.com
Execution Panel
Console is empty.
Find Frequency of Each Character is an interactive PYTHON dry run visualizer from the Strings 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.
# Python program to find frequency of each character
text = "hello"
# Method 1: Using dictionary
freq_dict = {}
for char in text:
if char in freq_dict:
freq_dict[char] = freq_dict[char] + 1
else:
freq_dict[char] = 1
# Method 2: Using collections.Counter
from collections import Counter
freq_counter = Counter(text)
print("String:", text)
print("Character frequencies (dictionary):", freq_dict)
print("Character frequencies (Counter):", freq_counter)