Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. # Duncan Keith
  2. # 14426143
  3. # 80 character or less description of what the program does
  4.  
  5. from math import *
  6.  
  7. # Functions
  8.  
  9. def populate_data():
  10.   return []
  11.  
  12. def product(data):
  13.   prod = 1
  14.   for i in data:
  15.     prod = prod * i
  16.   return prod
  17.  
  18. # Data Representation
  19.  
  20. data = []
  21.  
  22.  
  23. # Program that executes
  24.  
  25. data = populate_data()
  26. print(product([1,2,3,4,5]))
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. # What do I do with data in a list # these things are functions
  35. # 1. (list) -> value
  36. # 2. (list) -> (list)
  37. # 3. (list) -> void   # printing results or graphing results
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. # 1. Look at the problem and come up with a data representation for it
  52. # 2. Come up with a big picture plan of how to solve the problem
  53. # 3. Create function stubs (placeholder function)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement