Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
11 years ago
Diff never expires
Clear
Export
Share
Explain
11 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
20 lines
Copy
10 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
20 lines
Copy
def check(types, value):
def check(types, value):
value = int(value)
value = int(value)
Copy
Copied
Copy
Copied
if types
==
"cats:"
or types ==
"trees:"
:
if types
in (
"cats:"
,
"trees:"
)
:
return props[types] < value
return props[types] < value
Copy
Copied
Copy
Copied
elif types
==
"pomeranians:"
or types ==
"goldfish:"
:
elif types
in (
"pomeranians:"
,
"goldfish:"
)
:
return props[types] > value
return props[types] > value
return props[types] == value
return props[types] == value
props = {}
props = {}
with open("inpt.txt") as g:
with open("inpt.txt") as g:
for line in g:
for line in g:
Copy
Copied
Copy
Copied
line = line.strip(
"\n"
).split(
" "
)
line = line.strip(
).split(
)
props[line[0]] = int(line[1])
props[line[0]] = int(line[1])
with open("input16.txt") as f:
with open("input16.txt") as f:
for line in f:
for line in f:
Copy
Copied
Copy
Copied
line = line.strip(
"\n"
).split(
" "
)
line = line.strip(
).split(
)
if
(check(line[
2
], line[
3
].strip(","))
and check(line[4], line[5].strip(",")) and check(line[6], line[7]
)):
if
all
(check(line[
i
], line[
i+1
].strip(","))
for i in range(2,7,2
)):
print line
print line
Saved diffs
Original text
Open file
def check(types, value): value = int(value) if types == "cats:" or types == "trees:": return props[types] < value elif types == "pomeranians:" or types == "goldfish:": return props[types] > value return props[types] == value props = {} with open("inpt.txt") as g: for line in g: line = line.strip("\n").split(" ") props[line[0]] = int(line[1]) with open("input16.txt") as f: for line in f: line = line.strip("\n").split(" ") if (check(line[2], line[3].strip(",")) and check(line[4], line[5].strip(",")) and check(line[6], line[7])): print line
Changed text
Open file
def check(types, value): value = int(value) if types in ("cats:", "trees:"): return props[types] < value elif types in ("pomeranians:", "goldfish:"): return props[types] > value return props[types] == value props = {} with open("inpt.txt") as g: for line in g: line = line.strip().split() props[line[0]] = int(line[1]) with open("input16.txt") as f: for line in f: line = line.strip().split() if all(check(line[i], line[i+1].strip(",")) for i in range(2,7,2)): print line
Find difference