Page 243 - Information_Practice_Fliipbook_Class11
P. 243

print("Website Link: {}".format(site['websiteLink']))
                                              break
                                      else:
                                            print(f"'{siteNameToModify}' not found in the list of heritage sites.")

                                  elif adminOperation == 3:
                                        siteNameToDelete = input("Enter the name of the heritage site to delete: ")

                                      for site in heritageSites:
                                          if site['name'].lower() == siteNameToDelete.lower():
                                              heritageSites.remove(site)
                                                   print(f"Heritage site '{siteNameToDelete}' deleted successfully.")
                                              break
                                      else:
                                          print(f"'{siteNameToDelete}' not found in the list of heritage sites.")

                                  elif adminOperation == 4:
                                      print("\nList of World Heritage Sites in India:")
                                      for site in heritageSites:
                                          print("Name: {}".format(site['name']))
                                           print("Location: {}, {}".format(site['location']['district'],
                                            site['location']['state']))
                                          print("Built Year: {}".format(site['builtYear']))
                                          print("Built By: {}".format(site['builtBy']))
                                          print("Purpose: {}".format(site['purpose']))
                                          print("Website Link: {}".format(site['websiteLink']))
                                          print("")

                                  elif adminOperation == 5:
                                      print("Logging out.")
                                      break

                                  else:
                                      print("Invalid choice. Please enter a number between 1 and 5.")

                          else:
                              print("Incorrect admin credentials. Please try again.")

                      elif adminChoice == 2:
                          print("Quitting the program.")
                          break

                      else:
                          print("Invalid choice. Please enter a number between 1 and 2.")

                  while True:
                       userChoice  = int(input("\nUser  Menu:\n1. Search  and Display  Heritage  Site\n2.  Display
                      Sites by State\n3. Quit\nEnter your choice (1-3): "))

                      if userChoice == 1:


                                                                                             Python Dictionaries  229
   238   239   240   241   242   243   244   245   246   247   248