Skip to content

Instantly share code, notes, and snippets.

@LuuOW
Last active August 3, 2022 23:42
Show Gist options
  • Save LuuOW/6d9792e1c73d4fb03f2d778d40067aa3 to your computer and use it in GitHub Desktop.
Save LuuOW/6d9792e1c73d4fb03f2d778d40067aa3 to your computer and use it in GitHub Desktop.
Calculate Price
import json
def calculate(filename):
with open(filename) as f:
data = json.load(f)
for i in data:
data[i] = data[i]/300 * 0.6 # <- that is the percentage of actual price you want to sell for.
return data
print(calculate('prices.json')) # <- this is the name of the file you want to use.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment