-- Returns the number of seats in the US House of Representatives held by a given state in a given year (If no year is given, the current number of seats is returned)local p =
function p.main(frame) state = frame.args[1] if mw.ustring.len(state)>2 then state = frame:expandTemplate state = state:sub(4) end
year = tonumber(frame.args[2]) if year then census_number = (year - 1 - math.fmod(year-1,10))/10 - 178 end states =
if state
'-' or not seats then seats = frame:expandTemplate end else seats = states[state][#states[state]] end end return seatsend
return p