amusements / great_shows

Collection of performance in Taiwan with nice data format.
2 stars 0 forks source link

Keyword search in an article #16

Open yiwenhuang opened 6 years ago

yiwenhuang commented 6 years ago

article source from: http://www.bbc.com/news/science-environment-43928318

  1. Track & pull branch feature/search_text
  2. Create python file under the folder py_01_search_text and named as [yourname]_search.py
  3. Read a local file: article.txt
  4. Execute [yourname]_search.py, then prompt a dialog to input the keyword in order to search from article.
  5. Print the search word and total number of matched
  6. Push/Submit your code to github

Output sample: Keyword XXX: We have found ### matched in article

wei-lin-lee commented 6 years ago

Should we convert uppercase / lowercase?

yiwenhuang commented 6 years ago

最後一個練習:

  1. 搜尋字串要不分大小寫, 所以... The 跟 the  兩個單字都要算。   備註:請盡量使用 for loop 做字串搜尋