Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Name: ansakoy
- # Section: mechMOOC
- # Date:23.06.2013
- # hw1.py
- ##### Template for Homework 1, exercises 1.2-1.5 ######
- a = " | | "
- b = "--------"
- print a
- print b
- print a
- print b
- print a
- # Do your work for Exercise 1.2 here
- print "Oops. Did I have to write it here? OK, copy, paste"
- a = " | | "
- b = "--------"
- print a
- print b
- print a
- print b
- print a
- print "********** Exercise 1.3 **********"
- # Do your work for Excercise 1.3 here. Hint - how many different
- # variables will you need?
- print "Hell, but I've already done this."
- print "Let me recall what I know about functions for a change"
- def tic_tac_toe(x, y):
- print x
- print y
- print x
- print y
- print x
- tic_tac_toe(a, b)
- print "********** Exercise 1.4 **********"
- print "********* Part II *************"
- c = 3 * 5 / (2 + 3)
- d = (7 + 9) ** 0.5 * 2
- e = (4 - 7) ** 3
- f = (-19 + 100) ** (1/4.0)
- g = 6 % 4
- print c, d, e, f, g
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement