IndentationError expected an indented block

后端 未结 5 1901
借酒劲吻你
借酒劲吻你 2020-12-05 18:30

Here is the code:

def myfirst_yoursecond(p,q):

a = p.find(" ")
b = q.find(" ")
str_p = p[0:a]
str_q = p[b+1:]

if str_p == str_q:
    res         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 19:31

    This error also occurs if you have a block with no statements in it

    For example:

    def my_function():
        for i in range(1,10):
    
    
    def say_hello():
        return "hello"
    

    Notice that the for block is empty. You can use the pass statement if you want to test the remaining code in the module.

提交回复
热议问题