Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "copyright", "credits" or "license()" for more information. >>> 5 + 3 8 >>> 5/2 2.5 >>> $100/2 SyntaxError: invalid syntax >>> 100/2 50.0 >>> # this is a comment character >>> students = 90 >>> lab_capacity = 30 >>> labs_needed = students/lab_capacity >>> labs_needed 3.0 >>> # in Math: 4 + 5 = 11 - 2 # But, that isn't legal in Python: >>> 4 + 5 = 11 - 2 SyntaxError: can't assign to operator >>> total_points = 112 >>> my_points = 95 >>> my_score = my_points / total_points >>> my_score 0.8482142857142857 >>> print("My score on the test was",my_score) My score on the test was 0.8482142857142857 # At this point, we ran the program bio_calc.py # And, we fixed it in class, so that it prints, # e.g., 86.363636363636363 instead of 0.8636363636363 >>> My score on the BIO test was 86.36363636363636 Doing fine >>> >>> # storewide sale >>> 20/100 0.2 >>> discount_percentage = .2 >>> original_price = 100 >>> discount = original_price * discount_percentage >>> discount 20.0 >>> sale_price = original_price - discount >>> sale_price 80.0 # A second way to calculate the sale_price: >>> sale_price = original_price * (1 - discount_percentage) >>> sale_price 80.0 # The following is to show that you can change the value # of a variable. You can even change it to a different type # of variable. # Here, we assign an int >>> discount_percentage = 7 >>> discount_percentage 7 # Now, we assign a string, and Python doesn't complain! >>> discount_percentage = "Hello World" >>> discount_percentage 'Hello World' >>>