Skip to content

Commit

Permalink
comment: PEP8 규격 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
akran123 committed Feb 9, 2025
1 parent 5254064 commit da04397
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/racingcar/main.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
import random


def check_carname(x):
for i in x :
if len(i)>5:
raise ValueError
'''
이름 검증 절차
'''
for i in x :
if len(i)>5:
raise ValueError("자동차 이름은 5자를 초과할 수 없습니다.")

def carfoward():
"""
자동차 전진시키는 함수수
"""
a=random.randint(0,9)
if a>=4 :
return 1
else :
return 0

def status(Cars):
"""
진행상태를 나타내는 함수
"""
for key,value in Cars.items():
print(f"{key} : {value*'-'}")



def winner(Cars):
"""
최종 우승자를 나타내는 함수
"""
maxfoward=max(Cars.values())
winners=[key for key,value in Cars.items() if value==maxfoward]

print(f"\n최종 우승자 : {', '.join(winners)}")

def main():
Expand All @@ -31,7 +44,7 @@ def main():

trycount=int(input("시도할 횟수는 몇 회인가요?"))
if trycount ==0:
raise ValueError
ValueError("시도할 횟수는 0일 수 없습니다")

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

View check run for this annotation

Codecov / codecov/patch

src/racingcar/main.py#L47

Added line #L47 was not covered by tests

count=0
while count<trycount:
Expand Down

0 comments on commit da04397

Please sign in to comment.