Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. # Your name:
  2. # Your username:
  3. # CS111 PS03 Task 1
  4. # diamonds.py
  5. # Submission date:
  6.  
  7. #******************************************************************************
  8. # Pre-defined strings. You're not allowed to create any other new strings
  9. # with quotes in this program!
  10.  
  11. zeroStar = ' '
  12. oneStar = ' * '
  13. twoStar = ' * * '
  14. threeStar = '* * *'
  15. empty = ''
  16.  
  17. #******************************************************************************
  18. # Define your functions (diamondPattern and other necessary helper
  19. # functions) below
  20.  
  21. # Be sure to use meaningful function names, parameter names, and
  22. # variable names.
  23.  
  24. # Comment your code appropriately
  25. # In particular, every function definition should have a
  26. # triple-quoted docstring between the header and the body
  27. # that briefly explains what the function does.
  28.  
  29.  
  30.  
  31. #******************************************************************************
  32. # Testing block. Put all testing code indented inside this if block
  33. # Uncomment existing calls inside this testing block to run them
  34. # when you press the green run function in Canopy.
  35.  
  36. if __name__ == "__main__":
  37. '''All your testing code should go below.
  38. Uncomment and comment particular lines as appropriate.'''
  39.  
  40. #diamondPattern()
  41.  
  42. def oneStar_():
  43. print (oneStar + zeroStar + oneStar + zeroStar + oneStar + zeroStar + oneStar)
  44. return empty
  45.  
  46. def twoStar_():
  47. print (twoStar + zeroStar + twoStar + zeroStar + twoStar + zeroStar + twoStar)
  48. return empty
  49.  
  50. def threeStar_():
  51. print (threeStar + zeroStar + threeStar + zeroStar + threeStar + zeroStar + threeStar)
  52. return empty
  53.  
  54. def oneStar_stag():
  55. print (zeroStar, oneStar + zeroStar + oneStar + zeroStar + oneStar + zeroStar + oneStar)
  56. return empty
  57.  
  58. def twoStar_stag():
  59. print (zeroStar, twoStar + zeroStar + twoStar + zeroStar + twoStar + zeroStar + twoStar)
  60. return empty
  61.  
  62. def threeStar_stag():
  63. print (zeroStar, threeStar + zeroStar + threeStar + zeroStar + threeStar + zeroStar + threeStar)
  64. return empty
  65.  
  66. def diamondNorm():
  67. return oneStar_(), twoStar_(), threeStar_(), twoStar_(), oneStar_()
  68.  
  69. def diamondStag():
  70. return oneStar_stag(), twoStar_stag(), threeStar_stag(), twoStar_stag(), oneStar_stag()
  71.  
  72. diamondNorm()
  73. diamondStag()
  74. diamondNorm()
  75. diamondStag()
  76. diamondNorm()
  77. diamondStag()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement