String formatting syntax f in Python

This is the string formatting syntax in Python, where f means to use f-string to format the string, and variable names or expressions can be used to replace inside the curly braces. In this statement, f"\n\nUser: {query}" means to insert the value of the variable query into the string, use two newlines as separators in front of the string, and add "User:" the text.

Guess you like

Origin blog.csdn.net/qq_15821487/article/details/131051230