name = input("Type your name:")
phonenumber = input("type your phone:")
city = input("type your city:")

inner_dict = {
    'phonenumber': phonenumber,
    'city': city
}

with open('user_dict.txt') as f:
    data_str = f.readline()

if data_str == '':
    data_str = '{}'

outer_dict = eval(data_str)

outer_dict[name] = inner_dict

with open('user_dict.txt', mode='w') as file:
    file.write(str(outer_dict))

b7cec86f20842d81fd222db542b051d4b3b8fb94
<mask token>

<mask token>
with open('user_dict.txt') as f:
    data_str = f.readline()
if data_str == '':
    data_str = '{}'
<mask token>
with open('user_dict.txt', mode='w') as file:
    file.write(str(outer_dict))

name = input('Type your name:')
phonenumber = input('type your phone:')
city = input('type your city:')
inner_dict = {'phonenumber': phonenumber, 'city': city}
with open('user_dict.txt') as f:
    data_str = f.readline()
if data_str == '':
    data_str = '{}'
outer_dict = eval(data_str)
outer_dict[name] = inner_dict
with open('user_dict.txt', mode='w') as file:
    file.write(str(outer_dict))

name = input("Type your name:")
phonenumber = input("type your phone:")
city = input("type your city:")

inner_dict = {
    'phonenumber': phonenumber,
    'city': city
}

with open('user_dict.txt') as f:
    data_str = f.readline()

if data_str == '':
    data_str = '{}'

outer_dict = eval(data_str)

outer_dict[name] = inner_dict

with open('user_dict.txt', mode='w') as file:
    file.write(str(outer_dict))
