Changes between Version 1 and Version 2 of ThatsaBigNumberSolution


Ignore:
Timestamp:
Sep 4, 2017, 9:56:35 PM (8 years ago)
Author:
cdelgigante
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ThatsaBigNumberSolution

    v1 v2  
    66{{{
    77#!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!")
     8def inputNumber(prompt):
     9   inStr = ""
     10   while not inStr.isdigit():
     11      in = input(prompt)
     12   return int(in)
     13 
     14x=inputNumber("Enter x-->")
     15y=inputNumber("Enter y-->")
     16z = pow(x,y)
     17if z > 100:
     18  print("That's-a big number!")
     19else: 
     20  print("Aw, its only ",z)
    1921}}}
    2022
    2123== Output ==
    2224{{{
    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! 
     25Enter x--> 2
     26Enter y--> 3
     27Aw, its only 8                                                                                                                                                                               
    3128}}}