Error in Python 2 Implementation:- "ValueError: Unknown format code 'f' for object of type 'str' "


#1

class Solution:
# @param A : tuple of integers
# @param B : tuple of integers
# @return a double
def findMedianSortedArrays(self, A, B):

    value = -999999
    
    X,Y = (),()
    if(len(A) < len(B)):
        X,Y = A,B
    else:
        X,Y = B,A
    m,n = len(X),len(Y)
    
    if(m == 0):
        if(n%2 != 0):
            return Y[n//2]
        else:
            return (float(Y[n//2]+Y[n//2-1])/2)
    
    start = 0 
    end = m
    while(start <= end):
        part_X = (start+end)//2 
        part_Y = (n+m+1)//2-part_X
        
        minright_x,minright_y,maxleft_x,maxleft_y = 0,0,0,0
        
        #Create Variables for Checking
        if(part_X == 0):
            maxleft_x = value
        else:
            maxleft_x = X[part_X-1]
        
        if(part_X == m):
            minright_x = float(999999)
        else:
            minright_x = X[part_X]
        
        if(part_Y == 0):
            maxleft_y = value
        else:
            maxleft_y = Y[part_Y-1]
        
        if(part_Y == n):
            minright_y = float(999999)
        else:
            minright_y = Y[part_X]
        
        #Found Condition:
        
        if(maxleft_x <= minright_y and maxleft_y <= minright_x):
            if((n+m)%2 != 0):
                return float(max(maxleft_x,maxleft_y))
            else:
                return float(max(maxleft_x,maxleft_y)+min(minright_x,minright_y))/float(2)
        
        #Too much on the left-> Move towards the right on X
        if(maxleft_y > minright_x):
            start = part_X+1
        #Too much on the right-> Move towards the left on X
        else:
            end = part_X-1

Gives me an error for the test case:
A : [ -50, -41, -40, -19, 5, 21, 28 ]
B : [ -50, -21, -10 ]

Really Stuck Please Help