Computer Science, asked by muskanvishen, 5 months ago

Ask user to enter age, sex ( M or F ), marital status ( Y or N ) and then using following rules print their place of service.
if employee is female, then she will work only in urban areas.

if employee is a male and age is in between 20 to 40 then he may work in anywhere

if employee is male and age is in between 40 t0 60 then he will work in urban areas only.

And any other input of age should print "ERROR".

Answers

Answered by jai696
5

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

def place_of_service(age, gender, married):

if age < 20 or age > 60:

return "Error"

if gender == "F":

return "urban areas"

if 20 <= age <= 40:

return "anywhere"

return "urban areas"

age, gender, married = int(input("age: ")), input("M/F: "), input("Y/N: ")

print(place_of_service(age, gender, married))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by amritamohanty918
4

Answer:

 \huge \mathfrak \red {Answer}

def place_of_service(age, gender, married):

if age < 20 or age > 60:

return "Error"

if gender == "F":

return "urban areas"

if 20 <= age <= 40:

return "anywhere"

return "urban areas"

age, gender, married = int(input("age: ")), input("M/F: "), input("Y/N: ")

print(place_of_service(age, gender, married))

Similar questions