Python 3.2.3rc2 (default, Mar 21 2012, 06:59:51) [GCC 4.6.3] on linux2 Type "copyright", "credits" or "license()" for more information. >>> x = 'a-bunch-of-words' >>> x 'a-bunch-of-words' >>> x.split('-') ['a', 'bunch', 'of', 'words'] >>> str1 = 'Level : 25;Name : Cloud;HP : 976/976;MP : 85/85;Characters : Cloud, Aerith & Cid;Gil : 54916;Location : "Costa Del Sol"' >>> str1.split(';') ['Level : 25', 'Name : Cloud', 'HP : 976/976', 'MP : 85/85', 'Characters : Cloud, Aerith & Cid', 'Gil : 54916', 'Location : "Costa Del Sol"'] >>> elt = 'Level : 25' >>> elt 'Level : 25' >>> elt.index('L') 0 >>> elt.index('v') 2 >>> elt.index('sfasdf') Traceback (most recent call last): File "", line 1, in elt.index('sfasdf') ValueError: substring not found >>> elt.index('eve') 1 >>> elt.index('2') 8 >>> elt.index(':') 6 >>> elt[elt.index(':'):] ': 25' >>> elt[elt.index(':') + 2:] '25' >>> elt.split(':') ['Level ', ' 25'] >>> elt.split(':')[1] ' 25' >>> elt.split(' : ') ['Level', '25'] >>> elt.split(' : ')[1] '25' >>> elt = 'HP : 976/976' >>> elt 'HP : 976/976' >>> elt.split(' : ')[1] '976/976' >>> both_hp = elt.split(' : ')[1] >>> both_hp '976/976' >>> both_hp.split('/') ['976', '976'] >>> elt.split(' : ')[1].split('/') ['976', '976'] >>> elt 'HP : 976/976' >>> elt.count('9') 2 >>> ================================ RESTART ================================ >>> E. ====================================================================== ERROR: test_qaulity_points (__main__.TestJuly16) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/july25_tests.py", line 21, in test_qaulity_points course1 += course.create('Underwater basket weaving', 'ART234', '12S', 1.0, 'C') UnboundLocalError: local variable 'course1' referenced before assignment ---------------------------------------------------------------------- Ran 2 tests in 0.045s FAILED (errors=1) >>> ================================ RESTART ================================ >>> E. ====================================================================== ERROR: test_qaulity_points (__main__.TestJuly16) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/july25_tests.py", line 23, in test_qaulity_points self.assertEqual(course.quality_points(course1), 2.0) AttributeError: 'module' object has no attribute 'quality_points' ---------------------------------------------------------------------- Ran 2 tests in 0.034s FAILED (errors=1) >>> ================================ RESTART ================================ >>> F. ====================================================================== FAIL: test_qaulity_points (__main__.TestJuly16) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/sukaeto/test1/july25_tests.py", line 23, in test_qaulity_points self.assertEqual(course.quality_points(course1), 2.0) AssertionError: None != 2.0 ---------------------------------------------------------------------- Ran 2 tests in 0.089s FAILED (failures=1) >>> ================================ RESTART ================================ >>> .. ---------------------------------------------------------------------- Ran 2 tests in 0.028s OK >>>