This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Choose the best response for each question.
What construct would you use to iterate over an enumerable collection?
You can use a for...in loop.
for...in
You can use a for...to loop.
for...to
You can use a while...do loop.
while...do
Explain what's wrong with the code let value = if condition then true else 1.
let value = if condition then true else 1
Nothing is wrong and the code will compile.
You can't assign the result to a variable.
The data type must be the same in both if and else. The code let value = if condition then 2 else 1 would work.
if
else
let value = if condition then 2 else 1
Which numbers would the loop for i = 0 to 5 do printfn "%i " i print?
for i = 0 to 5 do printfn "%i " i
It will print 0, 1, 2, 3, 4.
It will print 0, 1, 2, 3, 4, 5.
It will print 1, 2, 3, 4, 5.
You must answer all questions before checking your work.
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?