Last active
November 14, 2021 16:18
-
-
Save roeniss/89efa8b4b0340ee4d9f5223476f9a7a2 to your computer and use it in GitHub Desktop.
Random group maker
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
# -*- coding: utf-8 -*- | |
import random | |
# ____ _____ ____ __ __ ______ ____ ____ | |
# /\ _`\ /\ __`\/\ _`\ /\ \/\ \/\__ _\/\ _`\ /\ _`\ | |
# \ \ \L\ \ \ \/\ \ \ \L\_\ \ `\\ \/_/\ \/\ \,\L\_\ \,\L\_\ | |
# \ \ , /\ \ \ \ \ \ _\L\ \ , ` \ \ \ \ \/_\__ \\/_\__ \ | |
# \ \ \\ \\ \ \_\ \ \ \L\ \ \ \`\ \ \_\ \__/\ \L\ \/\ \L\ \ | |
# \ \_\ \_\ \_____\ \____/\ \_\ \_\/\_____\ `\____\ `\____\ | |
# \/_/\/ /\/_____/\/___/ \/_/\/_/\/_____/\/_____/\/_____/ 2021.11.15 | |
# - - - - - - - - - - - - - - - - - | |
# 초기화 코드 - 상수 부분은 직접 채워주세요 | |
# - - - - - - - - - - - - - - - - - | |
MEMBERS = ["로니스1", "로니스2" ,"로니스3", "로니스4", "로니스5", "로니스6", "로니스7"] | |
GROUP_CNT = 4 | |
## https://www.random.org/integers/?num=1&min=-100000000&max=100000000&col=1&base=10&format=html&rnd=new 에서 얻은 정수를 입력 | |
SEED = 71359727 | |
random.seed(SEED) | |
# - - - - - - - - - - - - - - - - - | |
# 구현 코드 | |
# - - - - - - - - - - - - - - - - - | |
random.shuffle(MEMBERS) | |
groups = [[] for _ in range(GROUP_CNT)] | |
for idx, member in enumerate(MEMBERS): | |
groups[idx%GROUP_CNT].append(member) | |
# - - - - - - - - - - - - - - - - - | |
# 출력 코드 | |
# - - - - - - - - - - - - - - - - - | |
for idx, group in enumerate(groups): | |
print("\n{}번째 그룹 🔥 ----> {}".format(idx+1, ", ". join(group)), end ="\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
감사합니다 :)