logo
Loading...

[第二題]將所有. 換成 , 請問為何如果加上一層if 篩選 會跑不出來? - Cupoy

請問為何如果加上一層if 篩選 會跑不出來 . 被 , 取代的結果 #for i in range(...

[第二題]將所有. 換成 , 請問為何如果加上一層if 篩選 會跑不出來?

2021/02/23 05:28 下午
A
觀看數:20
回答數:3
收藏數:0

請問為何如果加上一層if 篩選 會跑不出來 . 被 , 取代的結果 #for i in range(len(all_review)): for i in range(len(all_review)): if '.' in all_review[i] == True: #不用再跑這層 all_review[i] = all_review[i].replace('.',',') 跑了if 這層 all_review 會是原來的狀態 array(['Wow,,, Loved this place,', 'Crust is not good,', 'Not tasty and the texture was just nasty,', 'Stopped by during the late May bank holiday off Rick Steve recommendation and loved it,', 'The selection on the menu was great and so were the prices,', 'Now I am getting angry and I want my damn pho,', for i in range(len(all_review)): #if '.' in all_review[i] == True: #不跑這層 才會是正確答案 all_review[i] = all_review[i].replace('.',',') 感謝您!!