Help me in solving DSSA19 problem

My issue

My code

# cook your dish here
def max_people_in_towers(towers,n):
    if n == 0:
        return 0
    elif n==1:
        return towers[0]
    dp = [0]*n 
    for i in range(2,n):
        dp[i] = max_dp([i-1],dp[i-2]+towers[i])
        return dp[-1]
    towers = [1,2,3,1,2]
    max_people = max_people_in_towers(towers, N)

    print("maximum number of people arya can place:",max_people)

Learning course: Kalasalingam Academy of Research and Education
Problem Link: CodeChef: Practical coding for everyone