In the following code example, what is the backslash doing?
variable = “She said, "Hello!"”
The backslash is being used as an escape character. This will allow the double quotes to be printed.
What escape character is used to enter a tab?
\t
How can you stop python from interpreting escape characters?
Though the use of raw strings.
A string will need the ‘r’ prefix.
Example:
string = r’line1\nline2’
Using a print statement, how would you print a straight line?
print(‘_’ * 40)
What functions is used to find the length of a string?
len