Skip to content

Commit

Permalink
style: PEP8 Style로 코드 변경
Browse files Browse the repository at this point in the history
PEP8 Style로 코드 변경
  • Loading branch information
AI-WonYJ committed Feb 10, 2025
1 parent 8145d0f commit 04ef0c3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/racingcar/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random


def is_number (Data):
"""
Data가 숫자인지 확인하는 함수.
Expand All @@ -10,26 +11,30 @@ def is_number (Data):
except ValueError as e:
raise ValueError("숫자만 입력해주세요.") from e # 숫자가 아닌 값 입력시 예외 처리

Check warning on line 12 in src/racingcar/main.py

View check run for this annotation

Codecov / codecov/patch

src/racingcar/main.py#L11-L12

Added lines #L11 - L12 were not covered by tests


def validate_input(Data):
for i in range(len(Data)):
if len(Data[i]) > 5:
raise ValueError("이름은 5자 이하만 가능합니다.")
Data[i] = [Data[i], 0]
return Data


def try_input():
print("시도할 횟수는 몇 회인가요?")
n = input()
is_number(n)
return int(n)


def play_1set_of_game(Data):
for i in range(len(Data)):
value = random.randint(0, 10)
if value >= 4:
Data[i][1] += 1
return Data


def check_winner(Data):
win_list, winner_count = list(), 0
for i in range(len(Data)):
Expand Down Expand Up @@ -62,6 +67,7 @@ def main():

print("최종 우승자 : {0}".format(', '.join(win_list)))


if __name__ == "__main__":
# 프로그램이 직접 실행될 때만 main() 함수를 호출
main()

0 comments on commit 04ef0c3

Please sign in to comment.