Skip to content

Commit 7c37ad0

Browse files
committed
format code
1 parent edf13ae commit 7c37ad0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
# 普通调用
192192
"{0}, {1} and {2}".format('spam', 'ham', 'eggs') # 基于位置的调用
193193
"{motto} and {pork}".format(motto = 'spam', pork = 'ham') # 基于Key的调用
194-
"{motto} and {0}".format('ham', motto = 'spam') # 混合调用
194+
"{motto} and {0}".format('ham', motto = 'spam') # 混合调用
195195
# 添加键 属性 偏移量 (import sys)
196196
"my {1[spam]} runs {0.platform}".format(sys, {'spam':'laptop'}) # 基于位置的键和属性
197197
"{config[spam]} {sys.platform}".format(sys = sys, config = {'spam':'laptop'}) # 基于Key的键和属性
@@ -516,7 +516,7 @@ def f(*args): print(args) # 在元组中收集不匹配的位置参数
516516
f(1, 2, 3) # 输出(1, 2, 3)
517517
def f(**args): print(args) # 在字典中收集不匹配的关键字参数
518518
f(a = 1, b = 2) # 输出{'a':1, 'b':2}
519-
def f(a, *b, **c): print(a, b, c) # 两者混合使用
519+
def f(a, *b, **c): print(a, b, c) # 两者混合使用
520520
f(1, 2, 3, x=4, y=5) # 输出1, (2, 3), {'x':4, 'y':5}
521521

522522
#-- 函数调用时的参数解包: * 和 ** 分别解包元组和字典

0 commit comments

Comments
 (0)