Project Euler #80: Square root digital expansion

  • + 0 comments

    import decimal num=decimal.Decimal(int(input())) dot100 = decimal.Context(prec=10000) num=num.sqrt(dot100) num=str(num) precision=int(input()) sum1=x=i=0 while num[i]!=".": i=i+1 num=num[:i]+num[i+1:] num=num[0:precision] print(sum([int(x) for x in num]))

    this is my code i am passing only the first test condition