


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
SyntaxError: EOL while scanning string literal. SyntaxError: expected an indented block. SyntaxError: invalid syntax.
Typology: Study notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!
Python Error Messages: Gotta Catch ‘em All
New and experienced programmers constantly cause errors. The error messages are often terse, so do a web search of the message to find out what it means. If you get an error message like ModuleNotFoundError: No module named 'my_module_name' , try doing a web search for the generic parts of the message like "ModuleNotFoundError: No module named" instead of “my_module_name”.
For each error you encounter:
Example:
✓ IndexError: string index out of range
IndexError: string index out of range
KeyError: 'some_text_here'
ModuleNotFoundError: No module named 'some_text_here'
NameError: name 'some_text_here' is not defined
SyntaxError: can't assign to literal
Version 1, 2019/8/15. https://inventwithpython.com Creative Commons 4.0 BY-NC-SA https://creativecommons.org/licenses/by-nc-sa/4.0/
SyntaxError: EOL while scanning string literal
SyntaxError: expected an indented block
SyntaxError: invalid syntax
SyntaxError: unexpected indent
TypeError: can only concatenate str (not "int") to str
TypeError: 'str' object is not callable
TypeError: unsupported operand type(s) for +: 'int' and 'str'
ValueError: invalid literal for int() with base 10: 'some_text_here'
ZeroDivisionError: division by zero