Submitted Questions

  • Python - How to Write a function

    How to Write a function kinda_format ( ) that take three arguments (each of which positive int ) - a,b,c- and tests whether the equality a^n +b^n=c^n holds for each n{2,3,...,10}. The function should return false if the equality does not hold for any value of n in the given range, and if there is a value of n for which the equality holds, the lowest such value (as in int)

    Hema

    • Jan 3rd, 2015

    Python code attached"python def kinda_format(a,b,c): for i in range(1,10): if( (a**i + b**i) == (c**i)): flag=1 return(i,1) ...