Diagonal Sum of a Square Matrix using python in Google collab

def diagonalDifference(arr):

   # Write your code here

   k = range(len(arr))

   l = range(len(arr))

   x=0

   y=0

   for i in k:

       for j in l:

           if i==j:

               x+=arr[i][j]

               ”’if i==1:

                   y+=arr[i][j]”’

           if i+j==len(arr)-1:

               y+=arr[i][j]

   if x>y:

       return(x-y)

   else:

       return(y-x)