Skip to content
Advertisement

How can I do a dictionary format with f-string in Python 3 .6?

How can I do this format with a Python 3.6 F-String?

JavaScript

Advertisement

Answer

Well, a quote for the dictionary key is needed.

f'My name {person["name"]} and my age {person["age"]}'

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement