Q2. A vender wants to determine whether he should serve foods to someone. He only serves
foods to people whose age is 18 or more and when he is not on fasting. Given the person's age,
and whether fasting time is in session, create a function which returns whether he should serve
foods.
Examples
should_serve_foods(17, True) ➞ False(No serve foods)
should_serve_foods(19, False) ➞ True(serve foods)
should_serve_foods(30, True) ➞ False(No serve foods)
1
Expert's answer
2021-09-27T01:17:15-0400
def should_serve_foods(age:int, fasting:bool):
if age >= 18 and not fasting:
return True
else:
return False
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment