check if one line in python
To check if a line is present in a string in Python, you can use the "in" keyword as follows:
string = "This is a sample string" if "sample" in string: print("Line found") else: print("Line not found")
Output: Line found
原文地址: https://www.cveoy.top/t/topic/bqcv 著作权归作者所有。请勿转载和采集!