簡體   English   中英

IndentationError:期望縮進塊在哪里?

[英]IndentationError: expected an indented block where?

 File "<ipython-input-9-80002b11f2f7>", line 16
    linest = i.strip().split(",")
    ^

不知道該怎么做或我必須在哪里設置第 16 行?

with open("names.csv", "r") as file:
    
    name = "Annie"
    state = "AK"
    gender = "F"
    
    xs = []
    ys = []
    
    counter = 0
    
    for i in file:
        counter += 1
        if counter >= 5:
      
        linest = i.strip().split(",")
        
        if linest[1] == name and linest[4] == state and linest[3] == gender:
            print (linest)
        
        xs.append(linest[1])
        ys.append(linest[3])
        
        print(xs)
        print(ys)

if counter >= 5:語句中沒有任何內容。 這就是為什么你有一個縮進錯誤。 在此處插入 pass 語句或其他代碼。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM