Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@
# - Prompts a user to enter their age.
# - Uses a conditional statement to check if the age is greater than or equal to 18.
# - Prints "You are eligible to vote" if true, otherwise "You are not eligible to vote."
# Prompt the user to enter their age
age = int(input("Enter your age: "))

# Check if the age is greater than or equal to 18 using conditional statements
if age >= 18:
print("You are eligible to vote.")
else:
print("You are not eligible to vote.")