import json


def main():
    mydict = {'name': 'David', 'age': 25, 'line': 54321, 'friends': ['LBJ',
        'KOBE'], 'cars': [{'brand': 'BMW', 'max_speed': 150}, {'branch':
        'Benz', 'max_speed': 150}]}
    try:
        with open('data.json', 'w', encoding='utf-8') as fs:
            json.dump(mydict, fs)
    except IOError as e:
        print(e)
    print('save completed')


if __name__ == '__main__':
    main()

238f25c3dd9050c574cb4abc2063aa03c53bc9dd
<mask token>

<mask token>


def main():
    mydict = {'name': 'David', 'age': 25, 'line': 54321, 'friends': ['LBJ',
        'KOBE'], 'cars': [{'brand': 'BMW', 'max_speed': 150}, {'branch':
        'Benz', 'max_speed': 150}]}
    try:
        with open('data.json', 'w', encoding='utf-8') as fs:
            json.dump(mydict, fs)
    except IOError as e:
        print(e)
    print('save completed')


<mask token>

<mask token>


def main():
    mydict = {'name': 'David', 'age': 25, 'line': 54321, 'friends': ['LBJ',
        'KOBE'], 'cars': [{'brand': 'BMW', 'max_speed': 150}, {'branch':
        'Benz', 'max_speed': 150}]}
    try:
        with open('data.json', 'w', encoding='utf-8') as fs:
            json.dump(mydict, fs)
    except IOError as e:
        print(e)
    print('save completed')


if __name__ == '__main__':
    main()

import json


def main():
    mydict = {'name': 'David', 'age': 25, 'line': 54321, 'friends': ['LBJ',
        'KOBE'], 'cars': [{'brand': 'BMW', 'max_speed': 150}, {'branch':
        'Benz', 'max_speed': 150}]}
    try:
        with open('data.json', 'w', encoding='utf-8') as fs:
            json.dump(mydict, fs)
    except IOError as e:
        print(e)
    print('save completed')


if __name__ == '__main__':
    main()
