layout | topic | title | language |
---|---|---|---|
exercise |
Strings |
Function with Choices |
R |
Write a function that concatenates and prints:
everything is: XXX.```
Where XXX is either a string or a number that is passed to the function
as a parameter. Use this function to print out the answer if the input parameter
is 42, but **don't actually do the printing from inside the function** (*think
about why printing from outside the function might generally be more useful*).
*If you don't understand why this question is fun/funny you can Google
it or, better yet, actually read Hitchhiker's Guide to the Galaxy, which
is one of the funniest books ever written. There is also a very valuable
programming lesson to this story.*