IndentationError expected an indented block after function definition on line 1
This error is commonly caused by a lack of indentation in Python code. After defining a function, you must indent the next line to indicate that it is part of the function's body. For example:
def my_function(): print("Hello, world!") print("This line is indented because it's part of the function body.")
If you forget to indent the next line, you will get the "IndentationError: expected an indented block" error. To fix it, simply add an indentation to the next line, like this:
def my_function(): print("Hello, world!") print("This line is indented because it's part of the function body.") print("So is this one!") # etc
原文地址: https://www.cveoy.top/t/topic/eePZ 著作权归作者所有。请勿转载和采集!