56.4k views
2 votes
Output each contact in contact_emails: first, complete the for loop statement. On the next line, provide the loop body with the appropriate print statement.

a. for contact in contact_emails:
print(contact)
b. for email in contact_emails:
print(email)
c. for person in contact_emails:
print(person)
d. for c in contact_emails:
print(c)

User Connie Yau
by
7.8k points

1 Answer

4 votes

Final Answer:

For contact in contact_emails: print(contact). The correct option is a. "for contact in contact_emails: print(contact)."

Step-by-step explanation:

This statement initiates a for loop where the variable 'contact' iterates over the elements in the 'contact_emails' list. In each iteration, it prints the current 'contact,' effectively outputting each contact in the 'contact_emails' list.

It's important to choose a variable name (e.g., 'contact') in the for loop that reflects the nature of the elements in the list. This enhances code readability and comprehension. Therefore, option a is the appropriate choice for outputting each contact from the 'contact_emails' list.

Option A is the answer: "for contact in contact_emails: print(contact)."