Загружаю ДЗ по классам
This commit is contained in:
parent
64a0f68df4
commit
98a5e3c233
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
main.py
|
|
@ -2,9 +2,13 @@ import json
|
||||||
|
|
||||||
|
|
||||||
def json_to_python():
|
def json_to_python():
|
||||||
with open("shapes.json") as shapes:
|
with open("shapes.json") as lines:
|
||||||
data = json.load(shapes)
|
data = json.load(lines)
|
||||||
return data
|
for shape in data["shapes"]:
|
||||||
|
print("Type:", shape["type"])
|
||||||
|
print("Color:", shape["color"])
|
||||||
|
print()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
print(json_to_python())
|
print(json_to_python())
|
||||||
|
|
Loading…
Reference in New Issue