Activity 3.3.
Try printing
Today is "Monday"!
to the screen. What happens?
What is the correct way to print quotation marks?
Hint.
Solution.
Within any string (deliminated by double quotes
" "
), a double quote needs to be “escaped”, that is, preceded by a backslash. Single quotes are actually okay within strings, but it is also okay to escape them. If you’d like to use a single quote within something enclosed by single quotes however, then you need to escape that single quote (but double quotes are okay, surrounded by single quotes).