0
0
SASSmarkup~10 mins

Built-in math functions in SASS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to calculate the square root of 16 using a built-in math function.

SASS
$result: math.[1](16);
Drag options to blanks, or click blank then click option'
Asqrt
Bpow
Cabs
Dround
Attempts:
3 left
💡 Hint
Common Mistakes
Using math.pow instead of math.sqrt
Using math.abs which returns absolute value
Using math.round which rounds numbers
2fill in blank
medium

Complete the code to round the number 4.7 down to the nearest whole number.

SASS
$rounded: math.[1](4.7);
Drag options to blanks, or click blank then click option'
Aabs
Bceil
Cround
Dfloor
Attempts:
3 left
💡 Hint
Common Mistakes
Using math.ceil which rounds up
Using math.round which rounds to nearest
Using math.abs which returns absolute value
3fill in blank
hard

Fix the error in the code to get the absolute value of -10.

SASS
$absValue: math.[1](-10);
Drag options to blanks, or click blank then click option'
Aabs
Bpow
Csqrt
Dround
Attempts:
3 left
💡 Hint
Common Mistakes
Using math.round which rounds numbers
Using math.pow which raises to a power
Using math.sqrt which finds square root
4fill in blank
hard

Fill both blanks to calculate 2 raised to the power of 3.

SASS
$power: math.[1](2, [2]);
Drag options to blanks, or click blank then click option'
Apow
B3
C4
Dsqrt
Attempts:
3 left
💡 Hint
Common Mistakes
Using math.sqrt instead of math.pow
Using 4 instead of 3 as exponent
Swapping base and exponent
5fill in blank
hard

Fill all three blanks to create a map of words to their lengths, but only include words longer than 3 characters.

SASS
$lengths: ([1]: [2] for [3] in $words if str-length([3]) > 3);
Drag options to blanks, or click blank then click option'
Aword
Bstr-length(word)
Dlength
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'length' instead of 'str-length(word)'
Using a different variable name in the loop
Not filtering words by length