PYTHON CODE ONLY

Given:

a variable current_members that refers to a list, and

a variable member_id that has been defined.

Write some code that assigns True to a variable is_a_member if the value associated with member_id can be found in the list associated with current_members, but that otherwise assigns False to is_a_member. Use only current_members, member_id, and is_a_member.

Respuesta :

ijeggs

Answer:

if member_id in current_members:

   is_a_member = True

else:

   is_a_member = False

Explanation:

Consider a complete program below (This is attached). In the python program we created and initialized a list of current members (Their ids).

Then we prompt user to enter his id.

The program returns "Your Id is found you belong" or "Your  id is not found"

Ver imagen ijeggs