Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!usr/local/bin/python3.8
- # -*- coding: utf-8 -*import
- names_input = input().split(', ')
- chairs_count = int(input())
- def combinations(names, chairs, comb=[]):
- if len(comb) == chairs:
- print(', '.join(comb))
- return
- for i in range(len(names)):
- x = names[i]
- comb.append(x)
- combinations(names[i + 1:], chairs, comb)
- comb.pop()
- combinations(names_input, chairs_count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement