Wednesday 16 October 2013

Week One

Week One was quiet with the main assignment being the installation of Python for those without it and a number of multi-choice questions to test understanding.

The code was a simple Hello World and a conditional variation so here is Julia code similar to the Python.


Note that Julia doesn't require Python's colons but instead uses an end to finish evaluations and functions.  Also Python uses indentation rigorously but Julia could care less about indentation or white space.  I will use Python conventions usually, simply because I like them.

If you want a quick look at the language Learn Julia in Y Minutes is surprisingly good.

2 comments:

  1. Your In[7] snippet uses "pass", which is a valid Python statement but is not defined in Julia. (It doesn't give an error here because it is in the branch of the conditional that isn't evaluated.) You could use "nothing" instead in Julia, which is the analogue of Python's "None".

    ReplyDelete