Basic US Election Tool

electoral_votes = {
    'Alaska': 3,
    'Hawaii': 4,
    'Washington': 12,
    'Oregon': 7,
    'California': 55,
    'Nevada': 6,
    'Idaho': 4,
    'Utah': 6,
    'Arizona': 11,
    'New Mexico': 5,
    'Colorado': 9,
    'Wyoming': 3,
    'Montana': 3,
    'North Dakota': 3,
    'South Dakota': 3,
    'Nebraska': 5,
    'Kansas': 6,
    'Oklahoma': 7,
    'Texas': 38,
    'Louisianna': 8,
    'Arkansas': 6,
    'Missouri': 10,
    'Iowa': 6,
    'Minnesota': 10,
    'Wisconsin': 10,
    'Illinois': 20,
    'Mississippi': 6,
    'Alabama': 9,
    'Tennessee': 11,
    'Kentucky': 8,
    'Indiana': 11,
    'Michigan': 16,
    'Ohio': 18,
    'West Virginia': 5,
    'Pennsylvania': 20,
    'New York': 29,
    'Vermont': 3,
    'New Hampshire': 4,
    'Maine': 4,
    'Massachusetts': 11,
    'Rhode Island': 4,
    'Conneticut': 7,
    'New Jersey': 14,
    'District of Columbia': 3,
    'Delaware': 10,
    'Maryland': 3,
    'Virginia': 13,
    'North Carolina': 15,
    'South Carolina': 9,
    'Georgia': 16,
    'Florida': 29
}
electors = len(electoral_votes.items())
votes = sum([*electoral_votes.values()])
print (electors, votes)
def get_votes(state):
    return electoral_votes.get(state)
def votes(party):
    return sum(map(lambda x: get_votes(x), party))
D = [
	'Hawaii',
	'Washington',
	'Oregon',
	'California',
	'Arizona',
	'Nevada',
	'New Mexico',
	'Colorado',
	'Minnesota',
	'Wisconsin',
	'Illinois',
	'Michigan',
	'Pennsylvania',
	'New York',
	'Vermont',
	'New Hampshire',
	'Maine',
	'Massachusetts',
	'Rhode Island',
	'Conneticut',
	'New Jersey',
	'Delaware',
	'Maryland',
	'District of Columbia',
	'Virginia',
	'Georgia'
	]
R = [
	'Alaska',
	'Idaho',
	'Montana',
	'Wyoming',
	'Utah',
	'North Dakota',
	'South Dakota',
	'Nebraska',
	'Kansas',
	'Oklahoma',
	'Texas',
	'Louisianna',
	'Arkansas',
	'Missouri',
	'Iowa',
	'Indiana',
	'Ohio',
	'West Virginia',
	'Kentucky',
	'Tennessee',
	'Mississippi',
	'Alabama',
	'North Carolina',
	'South Carolina',
	'Florida'
	]
print (votes(D))
print (votes(R))
>>> 
= RESTART: C:/Users/../Scripts/electoral_votes.py
51 538
306
232
>>> 
2 Likes