#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목중간고사 답안 공유좀 할수있을까요2019-07-10 16:57
작성자

dbList =  []


def makeString(year,month,day):

    if (year <= 0 ) or (year >= 2020):

        return False

    if (month <= 0 ) or ( month >= 13):

        return False

    if ( day <= 0 ) or ( day >= 32 ):

        return False

    else:

        year_str = str(year)

        month_str = str(month)

        day_str = str(day)

        return int(year_str[2:]+'0'+month_str+day_str)


year = int(input())

month =int(input())

day = int(input())

a = str(makeString(year, month, day))

makeString(year, month, day)


def fillListWithString(dbList, a):

    if dbList.count(a) != 1:

        dbList.append(a)

        return True

    if dbList.count(a) == 1:

        return False

    

fillListWithString(dbList,makeString(year,month,day))


def sortListWithString(dbList):

    newdb = sorted(dbList)

    return len(dbList)


sortListWithString(dbList)



제 답안인데, 쥬피터 노트북으로 실행했을때는 크게 문제없었는데

감점이 크게들어가서 다른분들의 코드가 궁금합니다ㅠ

댓글