25일차 - Printer Errors

--------------------------------------------🤞 My Solution -------------------------------------------

def printer_error(s):
    length = len(s)
    arr = ['a','b','c','d','e','f','g','h','i','j','k','l','m']
    count = 0
    for i in range(0, length):
        for j in range(0, arr.__len__()):
            if arr[j] == s[i]:
                count += 1
    error = length - count
    result = str(error) + '/' + str(length)
    return result

좋은 웹페이지 즐겨찾기