-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCounter.py
55 lines (38 loc) · 1.52 KB
/
Counter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import math
"""
This program is designed to count the given numbers
The context of the counting algorithm per book has a pass-fail threshhold, given that the
numbers originally represented test scores
Parameters
----------
input : list
our input list of numbers
Example : [1,3,6,78,3,1,443]
passMark : int
The pass-fail threshhold
total : int
total number of entries
count : int
our iterator value to compare against total
pass : int
current number of passing entries
current : float
current entry
total : integer
total number of entries
"""
def PassCount(input,passMark):
total = len(input) # define total
print("Total Number of Entries : %s" %(total)) # output total
passit = 0 # initialize count
count = 1 # initialize iterator
while count < total: # while iterator less than total length
for i in input: # for every entry in input
count += 1 # add to iterator
if input[i] >= passMark: # what if number pass threshhold ?
passit += 1 # add passing
print("Number of Passing Entries : %s" %(passit))
# END FUNCTION
input = [3,4,5,6,1,3,4,5]
passMark = 3
PassCount(input,passMark)