Need help with Python HW. Assignment attached.
Purpose: The purpose of this assignment is to allow you build on your what you learned in the previous exercises and homework to integrate new programming skills you've learned recently; the dictionary sequence type, the control flow statements you've learned about, user-defined function creation, and any modules you may find useful. You will also be asked to use the try:except error control to validate user input and to exit the system gracefully. You will utilize the skills you learned to create a simple game that: 1) creates a very basic profile of each user, 2) asks each user to add items to their collection, and 3) asks each user to guess the items in the other player's collection. Skills: - Break down complex problems into manageable tasks and submit as 'recipe' for creating game - Understand the various components of an application and build each, finally allowing them to work together - Utilize the dictionary (Links to an external site.) mapping type, the list (Links to an external site.) sequence type, and the tuple (Links to an external site.) sequence type (when needed) - Utilize the proper control flow statement to loop through your map or sequence - Understand how to create nested (Links to an external site.) (or multi-dimensional) dictionaries and/or lists/tuples and retrieve data - NOTE: You can nest a list or tuple inside a dictionary ~or~ nest a dictionary inside a list/tuple see: http://introtopython.org/dictionaries.html#Nesting (Links to an external site.) - Utilize try:except (Links to an external site.) to check for errors and to gracefully exit the program - Practice with creating and utilizing user-defined functions - Practice with including and utilizing any Python modules - Practice with output, variables, and receiving user input Knowledge: - Thinking and organizing your tasks in a logical manner and outputting as a 'recipe' - Understanding how to break large tasks into smaller, manageable chunks - Understanding the difference between a mapping data type (dictionary) and sequence data type (list) and when it's appropriate to use each - Gracefully exiting a program based on some feature (user input, number of guesses allowed, etc.) - Understanding how to check for errors before they occur - Knowing when to reuse your code (from previous assignments - think about the user- defined functions you've created or chunks of code that can be useful) - More experience with logic control flow, user input, and data types - Experience storing and retrieving information from dictionaries Task: To complete this assignment, you should first write a 'recipe' that describes the components of the game and submit this file separately from the Python code. Next, https://docs.python.org/3/tutorial/datastructures.html#dictionaries https://docs.python.org/3/library/stdtypes.html#list https://docs.python.org/3/library/stdtypes.html#list https://docs.python.org/3/library/stdtypes.html#tuples https://www.programiz.com/python-programming/nested-dictionary http://introtopython.org/dictionaries.html#Nesting https://docs.python.org/3/reference/compound_stmts.html#try you are to write a Python program that allows users to input basic demographic information (minimum of three pieces of demographic information) and then to create a collection of three items, with each item having at least two pieces of metadata attached to them. After this initial phase of the game, each user is allowed to try and guess an item from the other's collection. Each user can only have X guesses (you define X, e.g., you could allow a user guess a maximum of 10 times) before the game ends. You can alternate guessing or have one user guess all their guesses at one time. 1. Output a welcome message describing the application for the user and any/all instructions 2. At each step, give them the option to quit the game (i.e. In instructions, inform the players they may quit at any time by typing "Q" or something similar) 1. If a player quits, thank them for playing in a professional manner 2. Output score (if they've started guessing) 3. Ask the first player to input their demographic information (min of 3 pieces of info and you must include first name as one of the pieces of demographic information) and store the data 1. Validate data where applicable; e.g., if you ask for age, verify that they've given you an integer and not a string 4. Output blank lines (as you did in the previous assignment) and then ask for the second player's information. 5. Once demographic information is stored for both players, first ask the second player to hide their eyes and then ask the first player to input information for each item (minimum of three) in their collection. 1. Ask them by their first name (from the data you gathered in step #2) 2. This should include the item itself and the two pieces of metadata about the item (e.g. item=book; title=Neuromancer; author=William Gibson; year=1984) 1. Remember that the other player will try to guess the item, so please choose to store different items in your collection -- or, for example, if you have three books in your collection, you need to allow the other player to search by title or some other piece of metadata! Otherwise, they can easily guess correctly by just entering 'book'. 6. Repeat #4 for second player (don't forget to ask player one to hide their eyes). 7. Once demographic information and the items are all entered, output blank lines to hide previous input from the screen 8. Allow each player to guess the items in the other player's collection 1. Keep score by adding one point for each correct guess to a counter for each player 2. Keep a count of total guesses by adding one to a counter for each guess a player makes 9. Finish the round after X guesses or when a player guesses all the items in the other's collection 10. Present the option of playing again to the players at the end of the round Criteria for success: You will receive a perfect score if you: • Create a single recipe file and submit as *.txt or *.docx file separate from Python script • Provide comments for each section of your code describing what the code is doing • Add appropriate information to the docstring at the top of the script page in Spyder • Follow the rules relating to variable naming (as presented in the lectures) • Programmatically check to ensure player's have given you appropriate data • Output all instructions and appropriate information at the appropriate time • Utilize the dictionary mapping data type or a list and/or tuple sequence type to store information • Utilize the control flow statements to iterate through your dictionary, list, and/or tuple • Utilize the try:except for error control and to exit the program gracefully • Utilize user-defined functions • Have a complete, working script • Submit the script on time and in the proper format (*.py file) ------------------------ ::::: HINT ::::: Here's a rough sketch of what you might have in your game: storage_example.png ------------------------ BONUS POINT: I will give you a full bonus point if you give the player an option to receive a hint of some kind when they guess. You can accomplish this however you'd like, but it must work and you must only show a hint for items that have NOT been guessed at the time the player asks for a hint. https://canvas.wayne.edu/courses/120825/files/5477452/download?wrap=1