For this Question: Given a number N, your task is to convert the number into a single digit by repeatedly replacing the number N with its sum of digits until the number becomes a single digit.The input contains a single integer N.

Constraints:-
1 <= N <= 100000Print the single digit after performing the given operation.Sample Input:-
987

Sample Output:-
6

Explanation:-
987 - > 9 + 8 + 7 => 24 = 2 + 4 => 6

Sample Input:-
91

Sample Output:-
1, I have written this Solution Code: def singleDigit(n):
    while(n>9):
        p = n
        sumDigit = 0
        while(p>0):
            sumDigit += p%10
            p//=10
        n = sumDigit
    return sumDigit


, In this Programming Language: Python, Now tell me if this Code is compilable or not?