'ndigits' recursion

Write a function called ndigits, that takes an integer x (either positive or negative) as an argument. This function should return the number of digits in x.


In [11]:
def ndigits(x):
    x=abs(x)
    n=1
    while x/10 >=1:
        x=x/10
        n+=1
    return(n)

Radiation Exposure

In this problem, you are asked to find the amount of radiation a person is exposed to during some period.


In [ ]: