Functional Programming (H) - 2.05 - Nothing but the Truth
1. What is the value of this expression?
let x = 5 in x == 5
False
5
True
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"
There should not be any brackets around the condition
The condition is incorrectly typed, since it is an integer value
An endif statement is needed to show the end of the conditional expression
4. Which one of the following expressions does not evaluate to 42?
(*) 21 2
head (zip [42] [True])
[7,23,42] !! ((+) 1 1)
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 a a)
length (zip b b)
Submit Quiz