Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 11 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
11 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
20 lignes
Copier tout
10 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
20 lignes
Copier tout
def check(types, value):
def check(types, value):
value = int(value)
value = int(value)
Copier
Copié
Copier
Copié
if types
==
"cats:"
or types ==
"trees:"
:
if types
in (
"cats:"
,
"trees:"
)
:
return props[types] < value
return props[types] < value
Copier
Copié
Copier
Copié
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:
Copier
Copié
Copier
Copié
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:
Copier
Copié
Copier
Copié
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
Différences enregistrées
Texte d'origine
Ouvrir un fichier
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
Texte modifié
Ouvrir un fichier
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
Trouver la différence