Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. THREE FILES
  2. _________________________________________
  3. dif.py
  4. ________________________________________
  5. name1 = input('Enter the name of file1 : ')
  6. name2 = input('Enter the name of file2 : ')
  7. f1 = open(name1,'r')
  8. f2 = open(name2,'r')
  9. d1 = f1.readlines()
  10. d2 = f2.readlines()
  11. if d1==d2:
  12. print('Yes')
  13. exit
  14. for i in range(0,min(len(d1),len(d2))):
  15. if d1[i]!=d2[i]:
  16. print('NO')
  17. print(d1[i])
  18. print(d2[i])
  19. ________________________
  20. words.txt
  21. ________________________
  22. line 1
  23. line 2
  24. line 3 words
  25. ________________________
  26. writers.txt
  27. ________________________
  28. line 1
  29. line 2
  30. line 3 writers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement