Changes between Version 1 and Version 2 of ThatsaBigNumberSolution
- Timestamp:
- Sep 4, 2017, 9:56:35 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ThatsaBigNumberSolution
v1 v2 6 6 {{{ 7 7 #!python 8 count=1 9 while (count<=7): 10 if (count==4): 11 print("more!") 12 else: 13 print(count, end="") 14 for r in range(0,count): 15 print(" potato,", end="") 16 print("") 17 count+=1 18 print("score!") 8 def inputNumber(prompt): 9 inStr = "" 10 while not inStr.isdigit(): 11 in = input(prompt) 12 return int(in) 13 14 x=inputNumber("Enter x-->") 15 y=inputNumber("Enter y-->") 16 z = pow(x,y) 17 if z > 100: 18 print("That's-a big number!") 19 else: 20 print("Aw, its only ",z) 19 21 }}} 20 22 21 23 == Output == 22 24 {{{ 23 1 potato, 24 2 potato, 2 potato, 25 3 potato, 3 potato, 3 potato, 26 more! 27 5 potato, 5 potato, 5 potato, 5 potato, 5 potato, 28 6 potato, 6 potato, 6 potato, 6 potato, 6 potato, 6 potato, 29 7 potato, 7 potato, 7 potato, 7 potato, 7 potato, 7 potato, 7 potato, 30 score! 25 Enter x--> 2 26 Enter y--> 3 27 Aw, its only 8 31 28 }}}