library(learnr)
These exercises don't have checks.
An exercise using R.
stem(log(rivers))
stem(rivers)
```{python ex-python, exercise = TRUE} [x for x in [3, 4, 5, 6, 7] if x > 5]
```{python ex-python-hint} [x for x in [3, 4, 5, 6, 7] if x > 2]
Note: syntax highlighting works but no output will be shown unless you run the code in an IIFE and use console.log()
or window.alert()
.
``{js ex-js, exercise = TRUE, results = "asis"}
(function() {
const value = Math.min.apply(Math, [42, 6, 27])
window.alert(
The value is ${value}`)
})()
```{js ex-js-hint} console.log(Math.min(42, 6, 27))
```{julia ex-julia, exercise = TRUE}
let x = 0 while x < 4 println(x) x += 1 # Shorthand for in place increment: x = x + 1 end end
```{julia ex-julia-hint} for pair in Dict("dog" => "mammal", "cat" => "mammal", "mouse" => "mammal") from, to = pair println("$from is a $to") end
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.