Smallest number whose square has N digits | Python3 Program to find the smallest number whose square has N digits ; Function to return smallest number whose square has N digits ; Calculate N - th term of the series ; Driver Code
import math ; NEW_LINE def smallestNum ( N ) : NEW_LINE INDENT x = pow ( 10.0 , ( N - 1 ) / 2.0 ) ; NEW_LINE return math . ceil ( x ) ; NEW_LINE DEDENT N = 4 ; NEW_LINE print ( smallestNum ( N ) ) ; NEW_LINE