Page 242 - Information_Practice_Fliipbook_Class11
P. 242
locationDistrict = input("Enter the district where it is located: ")
locationState = input("Enter the state where it is located: ")
builtYear = input("Enter the year it was built: ")
builtBy = input("Enter who built it: ")
purpose = input("Enter why it was built: ")
websiteLink = input("Enter the website link (if any): ")
heritageSites.append({
'name': siteName,
'location': {
'district': locationDistrict,
'state': locationState,
},
'builtYear': builtYear,
'builtBy': builtBy,
'purpose': purpose,
'websiteLink': websiteLink,
})
print(f"\n'{siteName}' added. Updated list of heritage sites.")
elif adminOperation == 2:
siteNameToModify = input("Enter the name of the heritage site to modify: ")
for site in heritageSites:
if site['name'].lower() == siteNameToModify.lower():
print(f"\nCurrent Information for '{site['name']}':")
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']))
site['location']['district'] = input("Enter the modified district: ")
site['location']['state'] = input("Enter the modified state: ")
site['builtYear'] = input("Enter the modified built year: ")
site['builtBy'] = input("Enter the modified built by: ")
site['purpose'] = input("Enter the modified purpose: ")
site['websiteLink'] = input("Enter the modified website link: ")
print(f"Information for '{site['name']}' modified successfully.")
print("Updated Information:")
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']))
228 Touchpad Informatics Practices-XI

