Program to check voting eligibility using logical operators Dry Run in PYTHON

Program to check voting eligibility using logical operators is an interactive PYTHON dry run visualizer from the Io 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.

Program to check voting eligibility using logical operators Program Code

# Voting eligibility check
age = int(input("Enter your age: "))
citizen = input("Are you a citizen? (yes/no): ")

if age >= 18 and citizen.lower() == "yes":
    print("You are eligible to vote!")
elif age < 18:
    print("Sorry, you are too young to vote.")
else:
    print("Sorry, only citizens can vote.")

View the complete Io programs page.

Program Console Program to check voting eligibility using logical operators Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.