How can I do this format with a Python 3.6 F-String?
person = {'name': 'Jenne', 'age': 23} print('My name {0[name]} and my age {1[age]}'.format(person, person)) print('My name {0} and my age {1}'.format(person['name'], person['age']))
Advertisement
Answer
Well, a quote for the dictionary key is needed.
f'My name {person["name"]} and my age {person["age"]}'