Advertisement
ansakoy

MIT OCW 6.189 task 1

Jun 24th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. # Name: ansakoy
  2. # Section: mechMOOC
  3. # Date:23.06.2013
  4. # hw1.py
  5.  
  6. ##### Template for Homework 1, exercises 1.2-1.5 ######
  7.  
  8. a = " | | "
  9. b = "--------"
  10. print a
  11. print b
  12. print a
  13. print b
  14. print a
  15.  
  16.  
  17. # Do your work for Exercise 1.2 here
  18. print "Oops. Did I have to write it here? OK, copy, paste"
  19.  
  20. a = " | | "
  21. b = "--------"
  22. print a
  23. print b
  24. print a
  25. print b
  26. print a
  27.  
  28.  
  29. print "********** Exercise 1.3 **********"
  30.  
  31. # Do your work for Excercise 1.3 here. Hint - how many different
  32. # variables will you need?
  33. print "Hell, but I've already done this."
  34. print "Let me recall what I know about functions for a change"
  35.  
  36. def tic_tac_toe(x, y):
  37.     print x
  38.     print y
  39.     print x
  40.     print y
  41.     print x
  42. tic_tac_toe(a, b)
  43.  
  44.  
  45. print "********** Exercise 1.4 **********"
  46. print "********* Part II *************"
  47.  
  48. c = 3 * 5 / (2 + 3)
  49. d = (7 + 9) ** 0.5 * 2
  50. e = (4 - 7) ** 3
  51. f = (-19 + 100) ** (1/4.0)
  52. g = 6 % 4
  53. print c, d, e, f, g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement