【发布时间】:2022-11-03 19:34:51
【问题描述】:
鉴于以下示例:
from itertools import permutations
p=permutations("abc", 2)
def func():
for i in p:
print("values=", i)
print("First use case:")
func()
print("Second use case:")
func()
print("The End!")
输出:
First use case:
values= ('a', 'b')
values= ('a', 'c')
values= ('b', 'a')
values= ('b', 'c')
values= ('c', 'a')
values= ('c', 'b')
Second use case:
The End!
问题是关于第二个功能呼叫,为什么不打印值?!
【问题讨论】:
标签: python permutation