Question #312056

College student leader elections have ended and results have been delivered to the principal.principal wants to know the candidates who got minimum and maximum votes in the election

Expert's answer

import numpy as np
c = int(input("Enter no. of candidates: "))


Votes=[]
for r in range(0,c):
    s = "Enter Votes for Candidate-"+str(r+1)+": "
    t = int(input(s))
    Votes.append(t)
n = np.argsort(Votes)
print("The candidate-",n[0]+1," got minimum votes (=",Votes[n[0]]," votes)")
print("The candidate-",n[len(n)-1]+1," got maximum votes (=",Votes[n[len(n)-1]]," votes)")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS