Course of Raku / Essentials / Variables and data types essentials / Strings / Variable interpolation
Quiz: String interpolation
Select the strings, where the value of $x is
interpolated exactly one time.
| 1 | "The temperature is $x degrees" | |
| 0 | 'Air pressure is $x mmHg' | No interpolation in single quotes. |
| 0 | 'The value of \\$x is $x' | No interpolation and no escaping. It prints The value of \$x is $x. |
| 1 | "The value of \\$x is $x" | The whole phrase gives, for example, The value of $x is 42. |
| 0 | "The value of $x is $x" | $x is interpolated twice here. |
Course navigation
← Variable interpolation | Code interpolation →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська