Question: Rewrite the functionrecord_check(age, gender, location)below so that only a single if-statement is used. def record_check (age, gender, location) : buy only less than 5%

Rewrite the functionrecord_check(age, gender, location)below so that only a single if-statement is used.

def record_check(age, gender, location):  """ buy only less than 5% """ if age > 18: if gender == "M": if location == "Perth": print("Found him!") elif location == "Sydney": print("Found him!") else: print("Did not find him.") else: print("Did not find him.")  else:    print("Did not find him.")

Rewrite the functionrecord_check(age, gender, location)below so that only a single if-statement is

print ( "Did not find him.") else: print ("Did not find him.") else : print ( "Did not find him.") For example: Test Result record_check ( 16, 'F', 'Brisbane' ) Did not find him. record check (19, 'M', 'Perth' ) Found him! record_check (19, 'F', 'Melbourne' ) Did not find him. Answer: (penalty regime: 0, 10, ... %) 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!