Загружаю ДЗ по классам
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():
|
||||
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())
|
||||
|
|
Loading…
Reference in New Issue