Question: write a function in python 3 that can do the following must re ask user for input if the input is not an integer inputs
write a function in python 3 that can do the following
must re ask user for input if the input is not an integer
inputs are "1.5","a","0","5"
if 6 was the input, 91 would be the sum.

sum_natural_squares (N) --- int: a. This function accepts as the user input (string) as numerical value and returns the sum of the squares of the first N natural numbers. If the user input is not a natural number (an integer > 0), the function should return None. Note the string method .isdigit () is helpful. a. Parameters: N (string) b. Returns : int or None
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
