wiki:ThatsaBigNumberSolution

Version 1 (modified by cdelgigante, 8 years ago) (diff)

--

Back to: Programming?


That's-a Big Number Custom Function solution

Solution

count=1
while (count<=7):
   if (count==4):
      print("more!")
   else: 
      print(count, end="") 
      for r in range(0,count):
         print(" potato,", end="")
      print("")
   count+=1
print("score!")

Output

1 potato,                                                                                                                                                                                                                                              
2 potato, 2 potato,                                                                                                                                                                                                                                    
3 potato, 3 potato, 3 potato,                                                                                                                                                                                                                          
more!                                                                                                                                                                                                                                                  
5 potato, 5 potato, 5 potato, 5 potato, 5 potato,                                                                                                                                                                                                      
6 potato, 6 potato, 6 potato, 6 potato, 6 potato, 6 potato,                                                                                                                                                                                            
7 potato, 7 potato, 7 potato, 7 potato, 7 potato, 7 potato, 7 potato,                                                                                                                                                                                  
score!