Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import random
  2.  
  3. def count_marks(marks_list, bellow, above):
  4. count = 0
  5. for mark in marks_list:
  6. if mark >= bellow and mark <= above:
  7. count += 1
  8. print('\nThe number of students that obtained a mark between',
  9. '{}'.format(bellow), 'and {}'.format(above),
  10. 'were {}'.format(count))
  11.  
  12. marks = []
  13.  
  14. for i in range(30):
  15. marks.append(random.randint(0,10))
  16.  
  17. count_marks(marks, 9, 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement