• + 0 comments

    Python

    answer: 2/9

    from fractions import Fraction as F
    
    tot = 0
    tar = 0
    
    for i in range(10):
        for j in range(10):
            if i != j:
                tot += 1
                if abs(i-j) == 1 or abs(i-j) == 9:
                    tar += 1
    print(F(tar,tot))