- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 56字
- 2021-07-02 14:00:21
% string formatting operator
% is a string formatting operator in Python. Refer to the following example:
#!/usr/bin/python3
print ("Hello this is %s and my age is %d !" % ('John', 25))
Output:
Hello this is John and my age is 25 !
The following table shows a list of symbols used along with %:
