logo
Loading...

將所有sentence 中的第一個 the 置換成 The 一題的解答疑似有誤? - Cupoy

此解答同時會將 whether, there 等含有the拼字的字詞的 t 改為大寫 整句內的所有...

解答

將所有sentence 中的第一個 the 置換成 The 一題的解答疑似有誤?

2020/11/25 下午 07:01
Python 文字處理函數介紹
Chrissie
觀看數:28
回答數:3
收藏數:1
解答

1. 此解答同時會將 whether, there 等含有the拼字的字詞的 t 改為大寫 2. 整句內的所有 ‘the‘ 拼字皆會改成T,而非題目要求的僅改變第一個 (截圖自提供的解答檔案預覽) ![解答截圖.png](http://kwassistfile.cupoy.com/00000175FF050FC40000001E6375706F795F72656C656173655155455354/1606277312804/large)

回答列表

  • 2020/11/25 下午 08:51
    楊哲寧
    贊同數:2
    不贊同數:0
    留言數:2

    您好,目前寫法應該只有第一個the會被轉換成The,可以重新跑過程式碼一次試試看。 題目敘述可能不夠清楚,如果只針對 the 這個單詞,可以簡單改寫成 ```python for sentence_number in range(len(all_review)): input_sentence = all_review[sentence_number] if 'the' in input_sentence.split(): location = input_sentence.find('the') input_sentence = ''.join((input_sentence[:location],'T',input_sentence[location+1:])) all_review[sentence_number] = input_sentence ```

  • 2020/11/26 上午 11:29
    張維元 (WeiYuan)
    贊同數:1
    不贊同數:0
    留言數:0

    嗨,你好
    根據原題目/解答的設計, whether, there 是會被考慮的沒錯。我記得有跟主辦單位反應過,不確定之後是否會統一調整。

    嗨,你好,我是維元,持續在不同的平台發表對 #資料科學、 #網頁開發 或 #軟體職涯 相關的文章。如果對於內文有疑問都歡迎與我們進一步的交流,都可以追蹤我的 Facebook技術部落格 ,也會不定時的舉辦分享活動,一起來玩玩吧 ヽ(●´∀`●)ノ

  • 2021/01/09 下午 09:19
    Tommy
    贊同數:0
    不贊同數:0
    留言數:2

    請問這部分有更新一步的結果嗎?