Functional Programming (H) - 2.05 - Nothing but the Truth
1. What is the value of this expression?
let x = 5 in x == 5
True
False
5
2. Which one of the following expressions should always evaluate to True?
"haskell" < "python"
haskell < python
"haskell" <> "python"
3. What’s wrong with the following Haskell expression?
if (1) then "true" else "false"
The condition is incorrectly typed, since it is an integer value
An endif statement is needed to show the end of the conditional expression
There should not be any brackets around the condition
4. Which one of the following expressions does not evaluate to 42?
[7,23,42] !! ((+) 1 1)
head (zip [42] [True])
(*) 21 2
5. Given these definitions:
a = "england" b = "scotland"
then which one of the following expressions has the greatest integer value?
length (zip a b)
length (zip b b)
length (zip a a)
Submit Quiz