Skip to content

Ulises-Sanch3z/extra_credit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Practice OOP by making a Randomized Thanksgiving Guest List

Objective: The objective of this exercise is to create a Python script that randomizes a Thanksgiving guest list by assigning each guest a dish from the Thanksgiving menu. The script utilizes a class structure and includes methods to shuffle the list of dishes, print the randomized guest list, and practice printing individual objects of the class.

Instructions:

  1. Thanksgiving Menu:

    • The exercise begins with a predefined list of Thanksgiving menu items, such as turkey, stuffing, cranberry sauce, etc.
  2. Create a Class:

    • Define a class named ThanksgivingGuestList with methods to initialize the class, randomize the guest list, print the guest list, and print individual guest-dish assignments.
  3. Randomize Guest List:

    • Implement a method within the class that shuffles the list of Thanksgiving menu items and assigns each dish to a fictional guest.
  4. Print Guest List:

    • Develop a method to print out the randomized guest list in a readable format, showing each guest and their assigned dish.
  5. Print Individual Objects:

    • Practice printing individual objects of the class by creating an instance of the class, randomizing the guest list, and printing the dish assigned to a specific guest.
  6. Run the Script:

    • Instantiate the class, randomize the guest list, and print the results.
  7. Experiment:

    • Modify the script, such as adding more menu items, introducing additional languages for dish names, or exploring different ways to display the results.

Example Output: The output should include not only the randomized Thanksgiving guest list but also the ability to print individual guest-dish assignments. This allows students to practice accessing and displaying information about specific instances of the class.

Sample Output: Thanksgiving Guest List: Guest 1: macaroni and cheese Guest 2: pecan pie Guest 3: winter squash Guest 4: sweet potatoes Guest 5: coffee Guest 6: biscuits Guest 7: salad Guest 8: dressing Guest 9: gravy Guest 10: corn Guest 11: cranberry sauce Guest 12: quiche Guest 13: fresh fruit plate Guest 14: pumpkin pie Guest 15: apple cider Guest 16: rolls Guest 17: tea Guest 18: green beans Guest 19: turkey Guest 20: corn bread Guest 21: butter Guest 22: green bean casserole Guest 23: stuffing Guest 24: apple pie Guest 25: sweet potato pie Guest 26: mashed potatoes Guest 27: cru de te Guest 28: mac and cheese

Guest 3's Dish: winter squash

About

Thanksgiving Extra Credit Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages