ISBN verification

Below is my code for isbn verification 17 testcases passed except two. Please help me to solve this

def is_valid(isbn):
    count = 10
    sum = 0
    isbn.replace('-','')
    if len(isbn) != 10:
        return False
    for i in isbn:
        if i =='X' and count == 1:
            sum = sum + (10*1)
        if i.isdigit():
            sum = sum +(int(i) * count)
        count -= 1
    return sum % 11 == 0

Please use fenced code blocks for code snippets. Otherwise the Markdown parser might interpret some characters as formatting instructions and/or swallow indentation (which is especially bad for a language like Python).

I recommend editing your post.

But even with the incorrectly formatted code I might have an idea:
One of the lines does not what you think it does.

The first failing test expects is_valid("3-598-21508-8") to return True but actually it returns False.
This function returns False either somewhere at the beginning if len(isbn) is not 10, or at the end if the sum is not divisible by 11.
Can you find out which one of the two return statements returns the invalid result?
(You could print something out and check the captured output.)

Please also use codeblocks and not images to share the failing tests.

Thankyou got the output

Thankyou Sir Noted