Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. L = []
  2. name = input("podaj nazwe pliku ")
  3. file1 = open(name, 'r')
  4. Lines = file1.readlines()
  5. p1 = int(input("Podaj dolny przedzial "))
  6. p2 = int(input("Podaj gorny przedzial "))
  7. while(1 == 1):
  8. suma = 0
  9. for line in Lines:
  10. if ( int(line) >= p1 and int(line) <= p1 + 9 ):
  11. suma += 1
  12. print("W przedziale ", p1, " - ", p1 + 9, " : ", suma)
  13. p1 += 10
  14. if( p1 > p2 ):
  15. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement