wiki:ThatsaBigNumberSolution

Back to: Programming?


That's-a Big Number Custom Function solution

Solution

def inputNumber(prompt):
   inStr = ""
   while not inStr.isdigit():
      inStr = input(prompt)
   return int(inStr)
 
x=inputNumber("Enter x-->")
y=inputNumber("Enter y-->")
z = pow(x,y)
if z > 100:
  print("That's-a big number!")
else:  
  print("Aw, its only",z)

Output

Enter x--> 2
Enter y--> 3
Aw, its only 8                                                                                                                                                                                
Last modified 4 years ago Last modified on Sep 4, 2017, 9:57:25 PM