Undetected error on my budget.py code

I finished my budget code, I test it on my Idle, and it works. But it still fails the test on repl.it.
Please can you help me to figure out what is the error ?

Here is my code:

class Category:

    
    def __init__(self,name,balance=0):
        self.name = name.capitalize()
        self.balance = balance
        self.ledger = []

    def check_funds(self,amt):
        if amt > self.balance:
            return False
        else:
            return True

    def deposit(self, dep_amt, description=""):
        self.balance +=dep_amt
        self.ledger.append({"amount": dep_amt, "description": description})
        
    def withdraw(self, wd_amt, description=""):
        if not self.check_funds(wd_amt):
            return False
        else:
            self.balance -= wd_amt
            self.ledger.append({"amount": -wd_amt, "description": description})
            return True
        
    def get_balance(self):
        return self.balance
    
    def transfer(self,tf_amt,category):
        if not self.check_funds(tf_amt):
            return False
        else:
            self.withdraw(tf_amt,"Transfer to {}".format(category.name))
            category.deposit(tf_amt,"Transfer from {}".format(self.name))
            return True
        
    def __str__(self):
        a=0
        output = '{:*^30}'.format(self.name)
        total = 0
        for item in self.ledger:
            output = output +"\n"+'{:<23}{:>7.2f}'.format(self.ledger[a]['description'][0:23],self.ledger[a]['amount'])
            total = total + self.ledger[a]['amount']
            a+=1
        str_output = output + "\n" +"Total: {}".format(total)
        return str_output
        
        
def create_spend_chart(categories):
    line_title = "Percentage spent by category"
    line_10 = "100|"
    line_9 = " 90|"
    line_8 = " 80|"
    line_7 = " 70|"
    line_6 = " 60|"
    line_5 = " 50|"
    line_4 = " 40|"
    line_3 = " 30|"
    line_2 = " 20|"
    line_1 = " 10|"
    line_0 = "  0|"
    down_line = "    "+"-"*(len(categories)*3+1)
    wd_sum = []
    percentages = []
    lines = [line_0,line_1,line_2,line_3,line_4,line_5,line_6,line_7,line_8,line_9,line_10]
    for category in categories:
        a=0
        for transaction in category.ledger:
            if transaction['amount'] < 0:
                a +=transaction['amount']
        wd_sum.append(a)
    for total in wd_sum:
        percentages.append(int(round((total*100/sum(wd_sum)), -1 )))
    
    for percentage in percentages:
        c=0
        while percentage != -10:
            if 'o'not in lines[c]:
                lines[c] = lines[c]+' o'
            else:
                lines[c] = lines[c]+'  o'
            percentage = percentage - 10
            c += 1
    lines.reverse()
    #printing the categoriess names down the line
    names =[]
    for category in categories:
        names.append(category.name)
        
    count = len(names)
    lenght = max([len(a) for a in names])
    new_names = []
    for name in names:
        if len(name) <= lenght:
            name = name+ ' '*(lenght-len(name))
            new_names.append(name)
    if len(new_names) < 4 :
        for i in range(4-len(new_names)):
            new_names.append(' '*lenght)
    to_print = []
    new_to_print =[]
    for a,b,c,d in zip(new_names[0],new_names[1],new_names[2],new_names[3]):
        to_print.append(a+'  '+b+'  '+c+'  '+d+'  ')

    for character in to_print:
        a = character.rstrip()
        a = ' '*5+a+' '*2
        new_to_print.append(a)
#my last list to print the final ouput are lines,new_to_print. #without forgetting the downline as well
    
    string_A = ''
    string_B = ''
    for line in lines:
        string_A = string_A+'\n'+line
    for line in new_to_print:
        string_B = string_B+'\n'+line
    final_output = '\nPercentage spent by category'+string_A + '\n' + down_line + string_B
    
#return the final ouptut
    return final_output
    

And this is the link to my code:
my budget code

Code in the repl.it link is different than here. Which one is correct?

This one is correct
sorry for that. I edited the code as well

Test output shows first bar in char is high up to 70, while that’s the expected high of the second bar. Take a look where these bars are prepared to check if everything is fine there.

Hello,
Please I found what was wrong with my code and I corrected it.
but it still fail the test tho.
Can you help me to figure out what is wrong now, please? I don’t really understand the error message.

here is my new code :

class Category:

    
    def __init__(self,name,balance=0):
        self.name = name.capitalize()
        self.balance = balance
        self.ledger = []
        self.maxDiff = None

    def check_funds(self,amt):
        if amt > self.balance:
            return False
        else:
            return True

    def deposit(self, dep_amt, description=""):
        self.balance +=dep_amt
        self.ledger.append({"amount": dep_amt, "description": description})
        
    def withdraw(self, wd_amt, description=""):
        if not self.check_funds(wd_amt):
            return False
        else:
            self.balance -= wd_amt
            self.ledger.append({"amount": -wd_amt, "description": description})
            return True
        
    def get_balance(self):
        return self.balance
    
    def transfer(self,tf_amt,category):
        if not self.check_funds(tf_amt):
            return False
        else:
            self.withdraw(tf_amt,"Transfer to {}".format(category.name))
            category.deposit(tf_amt,"Transfer from {}".format(self.name))
            return True
        
    def __str__(self):
        a=0
        output = '{:*^30}'.format(self.name)
        total = 0
        for item in self.ledger:
            output = output +"\n"+'{:<23}{:>7.2f}'.format(self.ledger[a]['description'][0:23],self.ledger[a]['amount'])
            total = total + self.ledger[a]['amount']
            a+=1
        str_output = output + "\n" +"Total: {}".format(total)
        return str_output


def create_spend_chart(categories):
    line_title = "Percentage spent by category"
    line_10 = "100|"
    line_9 = " 90|"
    line_8 = " 80|"
    line_7 = " 70|"
    line_6 = " 60|"
    line_5 = " 50|"
    line_4 = " 40|"
    line_3 = " 30|"
    line_2 = " 20|"
    line_1 = " 10|"
    line_0 = "  0|"
    down_line = "    "+"-"*(len(categories)*3+1)
    wd_sum = []
    percentages = []
    lines = [line_0,line_1,line_2,line_3,line_4,line_5,line_6,line_7,line_8,line_9,line_10]
    F_line = []
    for category in categories:
        a=0
        for transaction in category.ledger:
            if transaction['amount'] < 0:
                a +=transaction['amount']
        wd_sum.append(a)
    for total in wd_sum:
        percentages.append(int((total*100/sum(wd_sum))))
    
    for index,line in enumerate(lines):
        e = eval(line.replace('|',''))
        for percentage in percentages:
            if percentage >= e:
                lines[index] = lines[index] + ' o '
            else:
                lines[index] = lines[index] + '   '
        
        
    lines.reverse()
    #printing the categoriess names down the line
    names =[]
    for category in categories:
        names.append(category.name)
        
    count = len(names)
    lenght = max([len(a) for a in names])
    new_names = []
    for name in names:
        if len(name) <= lenght:
            name = name+ ' '*(lenght-len(name))
            new_names.append(name)
    if len(new_names) < 4 :
        for i in range(4-len(new_names)):
            new_names.append(' '*lenght)
    to_print = []
    new_to_print =[]
    for a,b,c,d in zip(new_names[0],new_names[1],new_names[2],new_names[3]):
        to_print.append(a+'  '+b+'  '+c+'  '+d+'  ')

    for character in to_print:
        a = character.rstrip()
        a = ' '*5+a+' '*2
        new_to_print.append(a)
#my last list to print the final ouput are lines,new_to_print. #without forgetting the downline as well
    
    string_A = ''
    string_B = ''
    for line in lines:
        string_A = string_A+'\n'+line
    for line in new_to_print:
        string_B = string_B+'\n'+line
    final_output = line_title + string_A + '\n' + down_line + string_B
    
#return the final ouptut
    return final_output

This is the link to the code:
budget.app(updated)

Yeah… I have yet to figure where to set self.maxDiff=None xD
That aside, sanity already wrote it: Your food-bar goes up to 70, but should only go up to 60.
Reading the Readme reveals: You are supposed to round down. Instead you use round(value, -1) which follows standard rounding rules and in this one case rounds up.

OK, thanks.
I edited the rounding part of the code. It should be rounding down only now.

I’M stuck on this code for one week now. I would really love some help, please.
Thanks in advance

Take a look at the differences from error, they indicate formatting isn’t the same

AssertionError: 'Perc[34 chars]     \n 90|         \n 80|         \n 70|    o[329 chars] t  ' 
             != 'Perc[34 chars]      \n 90|          \n 80|          \n 70|  [340 chars] t  '