Number of Digits in a ^ b | Python Program to calculate no . of digits in a ^ b ; function to calculate number of digits in a ^ b ; Driver Program
import math NEW_LINE def no_of_digit ( a , b ) : NEW_LINE INDENT return ( ( int ) ( b * math . log10 ( a ) ) + 1 ) NEW_LINE DEDENT a = 2 NEW_LINE b = 100 NEW_LINE print ( " no ▁ of ▁ digits ▁ = ▁ " , no_of_digit ( a , b ) ) NEW_LINE