编程语言
首页 > 编程语言> > python排列组合

python排列组合

作者:互联网

python排列组合

import itertools
for i in itertools.combinations('12345', 4):
    print(i,"    ")
    print(i[0])
print('\n')

 

(wind_2021) F:\PytorchProject\yolov5-master>
(wind_2021) F:\PytorchProject\yolov5-master>python test_combination.py
('1', '2', '3', '4')
1
('1', '2', '3', '5')
1
('1', '2', '4', '5')
1
('1', '3', '4', '5')
1
('2', '3', '4', '5')
2



(wind_2021) F:\PytorchProject\yolov5-master>
(wind_2021) F:\PytorchProject\yolov5-master>

 

 

 

##############

标签:yolov5,python,PytorchProject,master,2021,排列组合,wind
来源: https://www.cnblogs.com/herd/p/15969161.html