Created
March 19, 2015 09:45
-
-
Save sota1235/2ec1e37021ff8c10b17d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding:utf-8 -*- | |
| # http://qiita.com/hisui@github/items/b47c411437d60440a605 | |
| p = int(input("人数を入力してください")) | |
| c = input("カードを空白区切りで入力してください").split() | |
| ans = [[] for i in range(p)] | |
| c = c[:-(len(c)%p)] | |
| for i in range(len(c)): | |
| ans[i % p].append(c[i]) | |
| print(ans) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment