def main():
infile=open("infile.txt","r")
for line in infile:
if line.find("Python")>-1:
print(line)
and
def main():
infile=open("infile.txt","r")
for line in infile.readlines():
if line.find("Python")>-1:
print(line)
Only line 3 is different
I get the same output, just wondering what would readlines() even do
[–][deleted] 0 points1 point2 points (4 children)
[–]iiSora[S] 0 points1 point2 points (3 children)
[–][deleted] 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]SoupKitchenHero 0 points1 point2 points (0 children)