Write a function called congress that takes two formal param

Write a function, called congress(). that takes two formal parameters: a person\'s age (int) and years of citizenship (int) as input and returns their eligibility for the Senate and House. The return value of the function is one of the following three: (1) Eligible for the Senate and the House.\' (2) \"Eligible only for the House.\" or (3) \"Not eligible for Congress.\" The caller of the function congress() in the test() function then prints a message using the format shown in the next problem. You must use if-elfin-else statements in your solution. Your congress() function must not print anything. Do not import external module in your solution. Write a test function, called test(), to test the congress() function with the following actual parameters and write a message accordingly: Call test() in your program and show the result Examples of the correct output format include: Age 45 with 17 years of citizenship: Eligible for the Senate and the House Age 18 with 18 years of citizenship: Not eligible for Congress

Solution

2.1 :

def congress(age,citi):

if age>=30&&citi>=15:

return \"eligible for senate and house\"

elif !age>=30 && citi>=15:

return \"eligible only for the house\"

else:

return \" not eligible for congress\"

2.2 :

def test():

print congress(65,25)

print congress(35,8)

print congress(35,5)

print congress(28,8)

print congress(24,5)

 Write a function, called congress(). that takes two formal parameters: a person\'s age (int) and years of citizenship (int) as input and returns their eligibil

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site