October 2014
Intermediate to advanced
280 pages
7h 20m
English
Write a function that returns true if a single-quoted string contains only printable ASCII characters (space through tilde).
Write an anagram?(word1, word2) that returns true if its parameters are anagrams.
Try the following in iex:
| | iex> [ 'cat' | 'dog' ] |
| | ['cat',100,111,103] |
Why does iex print ’cat’ as a string, but ’dog’ as individual numbers?
(Hard) Write a function that takes a single-quoted string of the form number [+-*/] number and returns the result of the calculation. The individual numbers do not have leading plus or minus signs.
calculate(’123 + 27’) # => 150
Read now
Unlock full access