How to use map in format in python
In this issue, the editor will bring you about the use of map in python's format. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
1. Format_map can only use variable data parameters to map relational data such as dictionaries in string format.
2. Grammar
Str.format_map (mapping)
3. Parameters, data of mapping dictionary type.
4. Returns the formatted string.
Example
Weather = "sunny day" hours = 7s = "the weather today is {weather}, and the time is now {hours} exactly." s.format_map (vars ()) above is the use of map in the format of python shared by the editor. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.