Question: using python Question 2: Suppose that the text file prop.txt contains a bunch of data about a single real estate property. In particular, suppose that
using python


Question 2: Suppose that the text file prop.txt contains a bunch of data about a single real estate property. In particular, suppose that the text file looks like this: Property 231 type: duplex square feet: 1752 bedrooms: 3 bathrooms: 1.5 (...etc.) Note that the first line is the name of the property, and then every other line after that contains some data about the property. Write a function convert() that creates a json file with the same information (the convert function does NOT need to take any input or return anything). The json file should be named prop.json and should look like this: { "Property 231": { "type": "duplex", "square feet": "1752", "bedrooms": "3", "bathrooms": "1.5", etc. } } Note that your code must work on any file with the format shown above. In particular, the grader may change the name of the property or add more data or change some of the data and your code should still work. For convenience, please feel free to keep all data as a str format (no need to convert to int or float)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
