Neec0

MechMOOC WK1 (6.189 hw1)

Jun 19th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. # Name: Nick H
  2. # Section: 6.189
  3. # Date: June 18, 2013
  4. # hw1.py
  5.  
  6. #prints "Hello World" to the screen
  7. print "Hello World!"
  8.  
  9.  
  10.  
  11. ##### Template for Homework 1, exercises 1.2-1.5 ######
  12.  
  13. print "********** Exercise 1.2 **********"
  14.  
  15. print " | |"
  16. print "________"
  17. print ""
  18. print " | |"
  19. print "________"
  20. print ""
  21. print " | |"
  22.  
  23.  
  24. print "********** Exercise 1.3 **********"
  25.  
  26. # Do your work for Excercise 1.3 here. Hint - how many different
  27. # variables will you need?
  28. print " "
  29. a = " | |"
  30. b = "________"
  31. c = ""
  32. print a
  33. print b
  34. print c
  35. print a
  36. print b
  37. print c
  38. print a
  39.  
  40.  
  41. print "********** Exercise 1.4 **********"
  42. print "********* Part II *************"
  43. from math import sqrt
  44.  
  45. print (3*5)/(2+3)
  46. print sqrt(7+9) * 2
  47. print (4-7)**3
  48. print ((-19 + 100)**(1/4.0))
  49. print 6 % 4
  50.  
  51. print "********* Part III *************"
  52.  
  53. a = 4 + (6 * 4) / 2
  54. b = (4 + 6) * 4 / 2
  55. print a
  56. print b
Advertisement
Add Comment
Please, Sign In to add comment