Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please make sure to look at the instructions. Thank you! Write a program to check whether a person is eligible for voting or not. Your
Please make sure to look at the instructions. Thank you!
Write a program to check whether a person is eligible for voting or not. Your program should validate the input from the user (although you don't have to ask for the input, in other words, no need to call input()). So you should write two functions: validate_age and check_eligibility. One of the functions does the following: 1. Its name is validate_age 2. It takes a string argument, called age 3. It checks if age is valid by checking that: it contains only 0 to 9 digits (in other words, it determines if age can be transformed to an integer), and that the integer is between 0 and 110 (inclusive). 4. It returns True if age is a valid integer, and False otherwise The second function does the following: 1. Its name is check_eligibility 2. It takes an integer argument, called age 3. If the age is greater or equal to 18 , return True, otherwise return Fa lse Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started