Answer to Question #312056 in Python for Pinky

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

1
Expert's answer
2022-03-15T16:47:37-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS