TypeError(str(ret) +”is not valid value for expected return type integer”)

42 Views Asked by At

I’ve been trying to do a problem on leetcode(29) and i submit my answer but it gives me this error. Here’s the code:

class Solution(object):
    def divide(self, dividend, divisor):
        """
        :type dividend: int
        :type divisor: int
        :rtype: int
        """
dividend = input()
divisor = input()
if -2^31 <= dividend and divisor != None and divisor<= 2^31 - 1:
 result = dividend/divisor
else:
 print("Invalid")
 exit()
print(result)

It should give me the int of the division.

0

There are 0 best solutions below