Загружаю ДЗ по классам

This commit is contained in:
ehermakov 2023-08-21 19:54:05 +03:00
parent 64a0f68df4
commit 98a5e3c233
3 changed files with 8 additions and 3 deletions

Binary file not shown.

View File

@ -2,9 +2,13 @@ import json
def json_to_python():
with open("shapes.json") as shapes:
data = json.load(shapes)
return data
with open("shapes.json") as lines:
data = json.load(lines)
for shape in data["shapes"]:
print("Type:", shape["type"])
print("Color:", shape["color"])
print()
return True
print(json_to_python())