Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a string variable named $greeting with the value Hello.
SASS
$greeting: [1]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes around the string value.
Using unquoted text which Sass treats as identifiers.
✗ Incorrect
In Sass, strings can be defined using single quotes. Here,
'Hello' correctly defines a string value.2fill in blank
mediumComplete the code to concatenate two strings $first and $second into $full.
SASS
$full: $first [1] $second; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
concat which is not a Sass operator.Using
+= which is not valid in Sass.✗ Incorrect
In Sass, the
+ operator concatenates strings. So $first + $second joins the two strings.3fill in blank
hardFix the error in the code to concatenate $name and $title with a space between.
SASS
$label: $name [1] " " [1] $title;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas which separate arguments but do not concatenate.
Using & or - which are not string concatenation operators.
✗ Incorrect
Use the plus sign
+ to concatenate strings and include a space string " " between them.4fill in blank
hardFill both blanks to create a string map where keys are names and values are titles concatenated with a colon and space.
SASS
$people: ("Alice": $alice[1] ": " [2] $title-alice, "Bob": $bob[1] ": " [2] $title-bob);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas which separate items but do not concatenate strings.
Using minus or other operators that cause errors.
✗ Incorrect
Use
+ to concatenate strings. Both blanks need the plus operator to join the parts.5fill in blank
hardFill all three blanks to create a nested map with concatenated string keys and values.
SASS
$data: ("user-"[1]: ("name": $user[2] " " [3] $lastname));
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using minus or other invalid operators.
Forgetting to concatenate the space between first and last names.
✗ Incorrect
Use the plus sign
+ to concatenate strings in all blanks for keys and values.