Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. ### Extra practice assignment
  2.  
  3. At various points in the LPTHW exercises, I'll add my own assignments.
  4. This is the first of these, to be completed after _Exercise 26_.
  5.  
  6. After you turn in your working program, I'll look for possible improvements, and ask
  7. you to make some changes.
  8.  
  9. #### Specifications
  10.  
  11. Write a program that will produce verses of "Old MacDonald". It should work as follows:
  12.  
  13. $ python oldmac.py duck quack
  14. Old MacDonald had a farm. E-I-E-I-O!
  15. And on that farm he had a duck. E-I-E-I-O!
  16. With a quack-quack here, quack-quack there, here a quack, there a quack, everywhere a quack, quack.
  17. Old MacDonald had a farm. E-I-E-I-O!
  18.  
  19. Notice in particular that the verse produced will make use of the command line arguments passed in `sys.argv`.
  20.  
  21. #### Things I'll look for
  22.  
  23. The main goal at this point is to have well organized, readable code. Using functions would probably
  24. be good.
  25.  
  26. #### Future ideas
  27.  
  28. Some thoughts that would be challenging at this point:
  29. - How could we change a/an when necessary?
  30. - How could we do multiple verses with more arguments?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement