Skip to content

Commit af92e8c

Browse files
committed
make data a list
1 parent 3998d8f commit af92e8c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

vartest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import json
22

3-
test_pet = {"name": "Spot", "id": 123}
3+
pet_list = [{"name": "Spot", "id": 123}]
44

55
def main():
66
with open("my_file.txt", "w") as f:
7-
json.dump(test_pet, f)
7+
pet_list.append({"name": "Spike", "id": 124})
8+
json.dump(pet_list, f)
89

910

1011
if __name__ == "__main__":

0 commit comments

Comments
 (0)