Question: write a python application to identify wonders of the world and their location. The purpose of this assignment is to gain experience in program
write a python application to identify wonders of the world and their location. The purpose of this assignment is to gain experience in program planning using pseudocode. You are given the pseudocode for the program and you will translate the code into a python application. Lab Scenario: 1. You are given a list containing the location and the name of the wonders of the world. 2. The program will ask user for a particular location or name of a wonder, or to press enter to receive a hint. 3. If the user requests a hint, a message is displayed providing only the location of the 7 wonders, and the program prompts the user again to enter the wonder name this time. 4. It will run through the list to search for the location/wonder name provided by the user. 5. The list is defined as follows: a. Each item of the list is a string. b. Location and wonder are separated by a colon (':'). c. You need to separate the location and the name of the wonder by (':'). Hint: Remember how you split a string? 6. If the location is found it will display the wonder located at the given location. 7. Similarly, the user could have entered a wonder name, and if the wonder is found, its location is displayed. 8. If the user input is not among the locations/wonders, the program should display the error message as: "Wrong input, the program ends here". 9. For this lab, you are expected to use for loop to iterate through each item in the list. The program needs to be case sensitive. For example: user can enter the name in all lowercase but the program will still find the name of the wonder if present in the list. Hint: string.lower() and string.upper() are two methods that can be used. 10. Seven wonders name in the list, shown below is also provided in your template file. seven_wonders = ["China:Great wall", "Jordan:Petra", "Brazil: Christ the Redeemer", "Peru: Machu Picchu","Mexico:Chichen Itza", "India:TajMahal", "Italy:Colosseum"] 11. Test the application by considering some possible 1/0 Pseudocode: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. Initialize the list of seven wonders Initialize a variable named 'found' and define it to be False at the beginning. Initialize a variable named 'hint' and define it to be zero at the beginning. Prompt user to enter the location/wonder or press enter for a hint. Check to see whether a hint is requested. If so, display the 7 locations and prompt the user again for an input. Reset hint to 1. Start for loop to iterate over the list items. If location is present in the list, and the hint variable is 0 Print wonder and its Location Reset 'flag' variable to be True If wonder is present in the list Print wonder and its Location Reset 'flag' variable to be True If 'flag' variable is False Print error message Enter location or name of a wonder of the world. If you need a hint press Enter: The 7 wonders of the world are in China, Jordan, Brazil, Peru, Mexico, India, and Italy. Enter the name of a wonder now: Brazil Incorrect entry. The program ends here. (Sample run 2) Enter location or name of a wonder of the world. If you need a hint press Enter: The 7 wonders of the world are in China, Jordan, Brazil, Peru, Mexico, India, and Italy. Enter the name of a wonder now: Colosseum Correct! Colosseum is located in Italy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
