Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- dacon
- 코로나19
- SW Expert Academy
- AI 경진대회
- leetcode
- github
- 금융문자분석경진대회
- 우분투
- 자연어처리
- Baekjoon
- Docker
- 맥북
- 파이썬
- 백준
- 프로그래머스 파이썬
- 캐치카페
- 더현대서울 맛집
- gs25
- 편스토랑 우승상품
- Git
- ubuntu
- ChatGPT
- Real or Not? NLP with Disaster Tweets
- PYTHON
- Kaggle
- 편스토랑
- programmers
- 데이콘
- 프로그래머스
- hackerrank
Archives
- Today
- Total
솜씨좋은장씨
[Programmers] 2022 KAKAO TECH INTERNSHIP - 성격 유형 검사하기 (Python) 본문
Programming/코딩 1일 1문제
[Programmers] 2022 KAKAO TECH INTERNSHIP - 성격 유형 검사하기 (Python)
솜씨좋은장씨 2022. 8. 30. 12:47728x90
반응형
코딩 1일 1문제! 오늘의 문제는 프로그래머스의 2022 KAKAO TECH INTERNSHIP 성격 유형 검사 하기 입니다.
👨🏻💻 코드 ( Solution )
def get_character_score(question, choice, score_list):
if 1 <= choice <= 4:
character_type = question[0]
score = score_list[choice-1]
elif 5 <= choice <= 7:
character_type = question[1]
score = score_list[choice-1]
return character_type, score
def get_high_score_character(score_dict, character1, character2):
if score_dict[character1] > score_dict[character2]:
high_score_character = character1
elif score_dict[character1] < score_dict[character2]:
high_score_character = character2
else:
high_score_character = min(character1, character2)
return high_score_character
def make_character_type_string(score_dict):
character_type_string = ""
character_list = [
("R", "T"), ("C", "F"), ("J", "M"), ("A", "N")
]
for character in character_list:
high_score_character = get_high_score_character(
score_dict=score_dict,
character1=character[0], character2=character[1]
)
character_type_string += high_score_character
return character_type_string
def solution(survey, choices):
character_type_score_dict = {
"R": 0, "T": 0, "C": 0, "F": 0,
"J": 0, "M": 0, "A": 0, "N": 0
}
score_list = [3, 2, 1, 0, 1, 2, 3]
for question, choice in zip(survey, choices):
character_type, score = get_character_score(
question=question, choice=choice, score_list=score_list
)
character_type_score_dict[character_type] += score
return make_character_type_string(score_dict=character_type_score_dict)
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 5361번 : 전투 드로이드 가격 (Pyhton) (0) | 2022.09.01 |
---|---|
[BaekJoon] 1718번 : 암호 (Python) (0) | 2022.08.30 |
[BaekJoon] 1837번 : 암호제작 (Python) (0) | 2022.08.29 |
[BaekJoon] 23825번 : SASA 모형을 만들어보자 (Python) (0) | 2022.08.29 |
[BaekJoon] 2999번 : 비밀 이메일 (Python) (0) | 2022.08.25 |
Comments