Here's a problem:
Write a program that asks the user to enter an integer and prints two integers, root and pwr, such that 0
Here's the code I wrote: ``` x=int(raw_input('Enter an integer: ')) pwr=0 root=0 test=0 for pwr in range (1,6): root=0 while root**pwr<abs(x): root+=1 ## print 'Current root is: ', root ## print 'Current power is: ', pwr if root**pwr==abs(x): test=1 print 'Root is: ', root print 'Power is: ', pwr else: if test!=1: print 'There´s no such integers' ``` Can you guys think about any situation that doesn't exist such a pair of integers? I mean, at least there will be root = x and pwr = 1, right?
Join our real-time social learning platform and learn together with your friends!