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
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)")
Comments
Leave a comment