Convert string to respective data type ie. int or long (python3)

Viewed 10070
temp=input()
l=list(map(int,temp.split()))
count=0
for i in range (1,min(l[0],l[1])+1):
    if l[0]%i==0 and l[1]%i==0:
        count+=1
print (count)

Above code takes 2 or more numbers and finds count of common factors. the range for these numbers is 1 to 10**12.

How to handle both int and long data types in this code? Kindly help.

1 Answers
Related