You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
669 B

преди 5 години
  1. #!/usr/bin/env python3
  2. #title :6-3.py
  3. #description :Opdracht 6.3 - Files Lezen
  4. #author :Marcel Haazen
  5. #email :marcel@haazen.xyz
  6. #date :04-10-2019 - 08:21
  7. #version :0.1
  8. #usage :python3 6-3.py
  9. #notes :
  10. #python_version :3.7.4
  11. #==============================================================================
  12. file = open("kaartnummers.txt", "r")
  13. n = 0
  14. i = 0
  15. li = 0
  16. for line in file:
  17. i = i+1
  18. fields = line.split(",")
  19. if n < int(fields[0]):
  20. n = int(fields[0])
  21. li = li+1
  22. print("Deze file telt",i,"regels")
  23. print("Het grootste kaartnummer is:",n,"en dat staat op regel",li+1)
  24. file.close