Skip to content

Commit 7f45076

Browse files
authored
Merge pull request yidao620c#348 from jumploop/patch-1
Update p15_interpolating_variables_in_strings.rst
2 parents 507b0d4 + 69850e4 commit 7f45076

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/c02/p15_interpolating_variables_in_strings.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Python并没有对在字符串中简单替换变量值提供直接的支持。
106106
107107
>>> name = 'Guido'
108108
>>> n = 37
109-
>>> '%(name) has %(n) messages.' % vars()
109+
>>> '%{name} has %{n} messages.' % vars()
110110
'Guido has 37 messages.'
111111
>>>
112112

0 commit comments

Comments
 (0)