Python 3.2.3 (default, Feb 20 2013, 14:44:27) [GCC 4.7.2] on linux2 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> F16 F. ====================================================================== FAIL: test_factorial (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 29, in test_factorial self.assertEqual(factorial_for(5), 120) AssertionError: 1 != 120 ====================================================================== FAIL: test_squared (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 40, in test_squared self.assertEqual(squared(4), 16) AssertionError: None != 16 ---------------------------------------------------------------------- Ran 3 tests in 0.012s FAILED (failures=2) >>> ================================ RESTART ================================ >>> FE. ====================================================================== ERROR: test_squared (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 40, in test_squared self.assertEqual(squared(4), 16) File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19.py", line 55, in squared print('the square of x is' + x**2) TypeError: Can't convert 'int' object to str implicitly ====================================================================== FAIL: test_factorial (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 29, in test_factorial self.assertEqual(factorial_for(5), 120) AssertionError: 1 != 120 ---------------------------------------------------------------------- Ran 3 tests in 0.012s FAILED (failures=1, errors=1) >>> ================================ RESTART ================================ >>> Fthe square of x is16 F. ====================================================================== FAIL: test_factorial (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 29, in test_factorial self.assertEqual(factorial_for(5), 120) AssertionError: 1 != 120 ====================================================================== FAIL: test_squared (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 40, in test_squared self.assertEqual(squared(4), 16) AssertionError: None != 16 ---------------------------------------------------------------------- Ran 3 tests in 0.015s FAILED (failures=2) >>> ================================ RESTART ================================ >>> FF. ====================================================================== FAIL: test_factorial (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 29, in test_factorial self.assertEqual(factorial_for(5), 120) AssertionError: 1 != 120 ====================================================================== FAIL: test_squared (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 40, in test_squared self.assertEqual(squared(4), 16) AssertionError: 'the square of x is16' != 16 ---------------------------------------------------------------------- Ran 3 tests in 0.010s FAILED (failures=2) >>> ================================ RESTART ================================ >>> F.. ====================================================================== FAIL: test_factorial (__main__.TestMarch7) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/good_stuff/documents/teaching/CISC106/spring-2013/examples/march19/march19tests.py", line 29, in test_factorial self.assertEqual(factorial_for(5), 120) AssertionError: 1 != 120 ---------------------------------------------------------------------- Ran 3 tests in 0.014s FAILED (failures=1) >>> x = [1, 2, '3', 'four', 5] >>> x [1, 2, '3', 'four', 5] >>> x[0] 1 >>> x[2] '3' >>> x[1] = 'two' >>> x [1, 'two', '3', 'four', 5] >>> x[1:3] = 2 Traceback (most recent call last): File "", line 1, in x[1:3] = 2 TypeError: can only assign an iterable >>> x[1:3] = [2] >>> x [1, 2, 'four', 5] >>> [2] * 3 [2, 2, 2] >>> [2, 2, 2] * 3 [2, 2, 2, 2, 2, 2, 2, 2, 2] >>> x = [1, 2, '3', 'four' 5] SyntaxError: invalid syntax >>> x = [1, 2, '3', 'four', 5] >>> x [1, 2, '3', 'four', 5] >>> x[1:3] = [2] * (3 - 1) >>> x [1, 2, 2, 'four', 5] >>> x[1:3] [2, 2] >>> x [1, 2, 2, 'four', 5] >>> x[::-1] [5, 'four', 2, 2, 1] >>>