📌  相关文章
📜  如何使用 python 代码示例检查文本文件中的特定单词

📅  最后修改于: 2022-03-11 14:47:01.597000             🧑  作者: Mango

代码示例1
file = open("search.txt")
    print(file.read())
    search_word = input("enter a word you want to search in file: ")
    if(search_word in file.read()):
        print("word found")
    else:
        print("word not found")