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

제목2020년 2학기 기말 질문입니다.2021-11-28 22:31
작성자
class IntegerAccumulator:

    l = []

    def getNewInteger(self,a):
        s = 0
        self.l.append(a)
        for i in self.l:
            s = s + i
        return int( s / len(self.l))    

    def getAccumulatedIntegrers(self):
        return self.l

    def getAverage(self):
        s = 0
        for i in self.l:
            s = s + i
        return int( s / len(self.l))  



### init 함수를 사용하지 않았습니다만 init 함수를 사용할 때나 사용하지 않을 때나
객체 = class()
객체.함수(파라메터)
식으로 출력하는것은 마찬가지인것 같아 위와같이 코딩하였습니다.
위의 코딩내용이 채점 기준에 걸리지 않는지 궁금합니다.
댓글