moved if temp>freq in highest frequency outside the inner loop, as it should be
This commit is contained in:
parent
a78f6deacc
commit
d8ad39d234
@ -63,8 +63,8 @@ def high_freq():
|
|||||||
for j in range(len(marks)): # Iterate through marks list using j again
|
for j in range(len(marks)): # Iterate through marks list using j again
|
||||||
if (marks[i] == marks[j]):
|
if (marks[i] == marks[j]):
|
||||||
temp_count+=1
|
temp_count+=1
|
||||||
if (freq_count < temp_count): # If temp_count is greater than freq_count value, then
|
if (freq_count < temp_count): # If temp_count is greater than freq_count value, then
|
||||||
freq_count = temp_count # Make freq_count equal to temp_count
|
freq_count = temp_count # Make freq_count equal to temp_count
|
||||||
print(f"\n-----\nHighest frequency is:\t{freq_count}\n-----")
|
print(f"\n-----\nHighest frequency is:\t{freq_count}\n-----")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user