Question 2: List

A group of friends decided to organize a potluck dinner. Each friend plans to bring a different type of dish to share with everyone. They start with an empty list of dishes and add items as they decide what to bring.

Write a Python program to help them keep track of their potluck dishes.

  1. Start by defining an empty list called dishes.
  2. Ask each friend what dish they plan to bring to the potluck.
  3. Append each dish to the dishes list as they decide.
  4. After each addition, use an if condition to check:
    • If the number of dishes in the list is more than 10, print a warning message that there are already a lot of dishes.
    • If the list contains a dish type that is already in the list, print a message indicating that a similar dish is already planned.
  5. After all friends have added their dishes, print the final list of dishes for the potluck.
Write what you are looking for, and press enter to begin your search!