Years and years

Report a typo

Convert the dictionary below to a JSON string named years_json. Specify the indent as 4.

Write a program in Python 3
import json


years = {2020: "leap year", 2021: "regular year", 2022: "regular year",
2023: "regular year", 2024: "leap year"}

# convert years to JSON string
___

Create a free account to access the full topic