import json
# Function to add "Price" to each entry in the JSON data
def add_price_to_json(json_data, price=100):
for category in json_data.values():
for item in category.values():
item["Price"] = price
return json_data
# Read JSON data from a file
with open('input.json', 'r') as file:
data = json.load(file)
# Modify the JSON data
modified_data = add_price_to_json(data)
# Write the modified JSON data back to a file
with open('output.json', 'w') as file:
json.dump(modified_data, file, indent=4)
print("Price added to each entry successfully.")input.json kısmına dosyanın ismini ekleyin. ardından çalıştırın