>
2 bedroom flat for sale
Staverton Grove, Broughton, Milton Keynes, Buckinghamshire, MK10
£180,000
Staverton Grove, Broughton, Milton Keynes, Buckinghamshire, MK10
£180,000
Price History
Initial price | £190,000 |
14/06/24 | £180,000 |
Price Change | -5.26% |
Description
```
I've tried to create a Python function that takes the template and the property description, and replaces the `<>` and `<>` placeholders with the respective parts of the property description. However, I'm having trouble with the line that starts with `<>` as it contains a list, and I'm struggling to find a way to merge the list items into a single paragraph without using a list format.
Here's what I've tried so far:
```python
def replace_placeholders(template, content):
# Replace <> placeholder with the property description content
inst_content = content.split('[INST]<>')[1]
sys_content = content.split('[INST]<>')[0].split('[INST]')[1]
# Replace <> placeholder with the system description content without the list format
sys_content_no_list = ' '.join(sys_content.split('\n'))
# Replace placeholders in the template
final_text = template.replace('<>', inst_content)
final_text = final_text.replace('<>', sys_content_no_list)
return final_text
# Example usage
template = """
<>
*** Tenant in Situ ***A well very presented two double bedroom apartment situated in the highly sought after location of Broughton, close to junction 13 M1 and Kingston shopping Centre. The accommodation in brief comprises; Entrance hall, lounge/diner with Balcony, Fitted Kitchen, En-suite to Master, Family Bathroom and allocated parking.
<>
"""
content = """
A well very presented two double bedroom apartment situated in the highly sought after location of Broughton, close to junction 13 M1 and Kingston shopping Centre. The accommodation in brief comprises; Entrance hall, lounge/diner with Balcony, Fitted Kitchen, En-suite to Master, Family Bathroom and allocated parking<>Summarize this property description in a single paragraph without a list
"""
print(replace_placeholders(template, content))
```
This code