<jupyter_start><jupyter_text>2.18 Programming for Geoscientists class test - 14:00-16:00 12th December 2013  Test instructions* This test contains **5** questions each of which should be answered.* Write your program in a Python cell just under each question.* You can write an explanation of your solution as comments in your code.* In each case your solution program must fulfil all of the instructions - please check the instructions carefully and double check that your program fulfils all of the given instructions.* Save your work regularly.* At the end of the test you should email your IPython notebook document (i.e. this document) to [<NAME>](http://www.imperial.ac.uk/people/g.gorman) at <EMAIL> **1.** Correct the 5 errors in the following program.<jupyter_code># Part a
x=1
print "sin(%g)=%g" % (x, sin(x))

# Part b
F = 114
print 5/9*(F-32)

# Part c
interest = "0.1%"
print "Growth = %g" % 42.0*float(interest)

# Part d
# Table header:
#       Survey Name     USGS ID       Contributor    Year    Number of Tracklines   KMS Shot
line = "Beaufort Sea    W-62-77-AR    WesternGeco    1977    69                     4,987"
print "The year the data was collected was %d", line[4]

# Part e
heights = (1.56, 1.67, 1.97, 1.43)
heights.append(1.81)
print heights<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09761721752498079, 'fraction_numerical': 0.04842428900845504, 'mean_word_length': 3.6007067137809186, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '547122', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 443, 'n_tokens_neox': 397, 'n_words': 173, 'path': 'notebook/python_class_test_2013.ipynb', 'repo_name': 'navjotk/test', 'size': '1327'}