Q:

Vote is not count

The simple program that tallies the votes of a four-candidate election.
Votes arrive one at a time, where a vote four Candidate is denoted by the number,
At last print the winner on the screen.
there is my code
candList = [0, 0, 0, 0]

while True:
    print '1 for First Candidate'
    print '2 for Second Candidate'
    print '3 for Third Candidate'
    print '4 for Fourth Candidate'
    print '5 for Exit Poll'

    cid = input('Enter Candidate Number to Vote: ')

    if cid == 5:
        break

    candList[cid - 1]

vote = max(candList)
candidate = candList.index(vote) + 1
print 'Winner is  Candidate', candidate, 'with', vote, 'Votes'

But the problem vote is not count..
I am give 1 candidate 3 votes but finally print
Result is : Winner is  Candidate 1 with 0 Votes

A:

There are number of problems in your code. 
First of all, id is a builtin function, do not use id as a variable name. The same goes for list Second, line 15 (list[id-1]) obviously does nothing . Third, you should not use eval for converting strings into integers, use int instead. 
This code should do the work, but it still have some caveats: user can input 15 or not a number and the program will be terminated, also it doesn't handle a situation when two candidates get the same amount of votes
lst = [0, 0, 0, 0]

while True:
    print '1 for First Candidate'
    print '2 for Second Candidate'
    print '3 for Third Candidate'
    print '4 for Fourth Candidate'
    print '5 for Exit Poll'

    cid = int(input('Enter Candidate Number to Vote: '))

    if cid == 5:
        break

    lst[cid - 1] += 1

vote = max(lst)
candidate = lst.index(vote) + 1
print 'Winner is  Candidate', candidate, 'with', vote, 'Votes'

A:

You never assign a value to list[cid - 1]. You should change that line into the following:
list[cid - 1] += 1

Also, I would recommend you do not use list as the name for your list.

