Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the names and ages of two people, write a Python program to return if one, both, or neither people are between 1 8 and
Given the names and ages of two people, write a Python program to return if one, both, or neither people are between and years old inclusive You must use a logical "and" or or and you must return the words "ONE", "BOTH" and "NEITHER" when appropriate. Use a Boolean variable to simplify your code if you can. def printageelagibilitynamefirstperson, agefirstperson, namesecondperson, agesecondperson: # We write function to solve problems in chunks, reuse code and modularize code.
Write your function Docstring here' # Function docstring says what it does.
output # Initialization
# You should write the rest of the code
return output # return your result, don't print
# We use main program to use, test our solution. Sometimes we call it the client or the driver program.
def main:
# collect the input here from the user not from the function.
firstperson inputPlease enter the name of one person:
# You should write the rest of the code
# print a call to your function above here
# Code below simply runs the main Don't worry we will soon learn about this syntax.
if namemain:
# call main here
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