If you are trying to print a string, what happens if you leave out one of the quotation marks or both and why? A: Missing one quotation mark: Shows the error EOL. This error happens while python is reading the string. Literally "EOL" stands for "End of Line". An EOL error means that Python hit the end of a line while going through a string and in this case couldn't find the quotation mark. >>> print ('String) File "<stdin>", line 1 print ('String) ^ SyntaxError: EOL while scanning string literal Without quotation marks: Shows the error NameError: name 'String' is not defined. This error happens because the interpreter looks for the variable not defined 'String'. print (String) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'String' is not defined You can use a minus sign to make a negative number like -2. What happens for each of the following and
You've reached the end of your free preview.
Want to read both pages?
- Winter '17