def example_function():
print("This is a correctly indented function.")
if True:
print("This line is also correctly indented.")
# The following line will cause an "unexpected indent" error
print("This line is incorrectly indented.") # error: unexpected indent
# Explanation:
# In Python, indentation is used to define the blocks of code.
# An "unexpected indent" error occurs when a line is indented more than expected.
# In this example, the last print statement is incorrectly indented with four extra spaces,
# which causes the "unexpected indent" error.
error
上一篇:python列表操作
下一篇:python终止程序的命令
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站