Finding out if the given two files are identical in Python

✋✋✋💓💓


Following is the code you can use in python to find out if the given two files are identical to each other or not.

file1 = "file name 1"
file2 = "file name 2"

with open(file1) as f:
    contentF = f.read()


with open(file2) as g:
    contentG = g.read()

if contentF in contentG:
    print("yes")
else:
    print("No")


💓💓💓💓💓💓💓💓💓💓

Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes