For this Question: Given two integers L and R, where L and R represent the lower and upper limits of a range, find the count of lucky numbers in that range. A lucky number is defined as a number whose last digit is 7, 2, or 9.
Please calculate the number of lucky numbers in the range L to R.

Constraints : 1 <= L <= R <= 100000In the first line, enter the first positive integer L, where L represents the lower limit of the range.
In the second line, enter the second positive integer R,  where R represents the upper limit of the range.
Print the count of integers that ends with 7,2,9 within the given range.Sample1:
Input : 
1
10

Output : 
3

Sample2:
Input:
1
1000000

Output:
Invalid inputs. Check the constraints for L and R

Sample3:
Input:
-1
100

Output:
Invalid inputs. Check the constraints for L and R, I have written this Solution Code: def Newton_lucky(L,R):
     count = 0
     num = L
     if L<1 or R>10**5 or L>R:
          print("Invalid inputs. Check the constraints for L and R")
     else:
          for num in range(L, R):
               if num%10 == 2 or num%10 == 7 or num%10 == 9:
                    count+=1
                    num+=1
     
          print(count)

Newton_lucky(int(input()), int(input()))
, In this Programming Language: Python, Now tell me if this Code is compilable or not?